public class StreamUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
IO_BUFFER_SIZE |
Modifier and Type | Method and Description |
---|---|
static void |
closeStream(Closeable stream)
Closes the specified stream.
|
static long |
copy(InputStream in,
OutputStream out)
Copy the content of the input stream into the output stream, using a temporary byte array
buffer whose size is defined by
IO_BUFFER_SIZE . |
public static final int IO_BUFFER_SIZE
public static long copy(InputStream in, OutputStream out) throws IOException
IO_BUFFER_SIZE
.in
- The input stream to copy from.out
- The output stream to copy to.IOException
- If any error occurs during the copy.public static void closeStream(Closeable stream)
stream
- The stream to close.