public class StreamUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copyStream(InputStream is,
OutputStream os)
Copies data from the given InputStream to the given OutputStream.
|
static void |
copyStream(InputStream is,
OutputStream os,
int bufferSize)
Copies data from the given InputStream to the given OutputStream.
|
static byte[] |
streamToBytes(InputStream is)
Returns a byte array containing the data from the given InputStream.
|
public static byte[] streamToBytes(InputStream is) throws IOException
is - the InputStreamIOException - an IOException occurredpublic static void copyStream(InputStream is, OutputStream os) throws IOException
is - the InputStreamos - the OutputStreamIOException - an IOException occurredpublic static void copyStream(InputStream is, OutputStream os, int bufferSize) throws IOException
is - the InputStreamos - the OutputStreambufferSize - the buffer size in bytesIOException - an IOException occurred