public final class StreamUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(InputStream inputStream,
OutputStream outputStream)
Copy the contents of the provided InputStream to the provided OutputStream.
|
static byte[] |
toByteArray(InputStream inputStream)
Copy the contents of the provided InputStream into a byte array.
|
static String |
toString(InputStream inputStream,
Charset charset)
Copy the contents of the provided InputStream into a String.
|
public static String toString(InputStream inputStream, Charset charset) throws IOException
Note! InputStream will not be closed.
inputStream - the InputStream to copy fromcharset - A charsetIOException - inputStream case of I/O errorspublic static byte[] toByteArray(InputStream inputStream) throws IOException
Note! InputStream will not be closed.
inputStream - the InputStream to copy fromIOException - inputStream case of I/O errorspublic static void copy(InputStream inputStream, OutputStream outputStream) throws IOException
Note! InputStream and OutputStream will not be closed.
inputStream - the InputStream to copy fromoutputStream - the OutputStream to copy toIOException - inputStream case of I/O errorsCopyright © 2023. All rights reserved.