Package com.liferay.petra.io
Class StreamUtil
java.lang.Object
com.liferay.petra.io.StreamUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static byte[]
toByteArray
(InputStream inputStream) static String
toString
(InputStream inputStream) static String
toString
(InputStream inputStream, String charsetName) static void
transfer
(InputStream inputStream, OutputStream outputStream) static void
transfer
(InputStream inputStream, OutputStream outputStream, boolean cleanUp) static void
transfer
(InputStream inputStream, OutputStream outputStream, int bufferSize) static void
transfer
(InputStream inputStream, OutputStream outputStream, int bufferSize, boolean cleanUp) static void
transfer
(InputStream inputStream, OutputStream outputStream, int bufferSize, boolean cleanUp, long length) static void
transfer
(InputStream inputStream, OutputStream outputStream, long length)
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZE -
FORCE_TIO
public static final boolean FORCE_TIO
-
-
Constructor Details
-
StreamUtil
public StreamUtil()
-
-
Method Details
-
cleanUp
- Throws:
IOException
-
toByteArray
- Throws:
IOException
-
toString
- Throws:
IOException
-
toString
- Throws:
IOException
-
transfer
- Throws:
IOException
-
transfer
public static void transfer(InputStream inputStream, OutputStream outputStream, boolean cleanUp) throws IOException - Throws:
IOException
-
transfer
public static void transfer(InputStream inputStream, OutputStream outputStream, int bufferSize) throws IOException - Throws:
IOException
-
transfer
public static void transfer(InputStream inputStream, OutputStream outputStream, int bufferSize, boolean cleanUp) throws IOException - Throws:
IOException
-
transfer
public static void transfer(InputStream inputStream, OutputStream outputStream, int bufferSize, boolean cleanUp, long length) throws IOException - Throws:
IOException
-
transfer
public static void transfer(InputStream inputStream, OutputStream outputStream, long length) throws IOException - Throws:
IOException
-