public final class StreamUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(java.io.InputStream in,
java.io.OutputStream out)
Copy all bytes from in to out using a static buffer size of 1024 bytes.
|
static void |
copy(java.io.InputStream in,
java.io.OutputStream out,
int bufferSize)
Copy all bytes from
in to out using a buffer with the given bufferSize. |
static void |
copyAsync(java.io.InputStream readFrom,
java.io.OutputStream writeTo)
Starts a thread that reads data from the given
InputStream and writes them into the given
OutputStream. |
public static void copyAsync(java.io.InputStream readFrom,
java.io.OutputStream writeTo)
InputStream and writes them into the given
OutputStream. This thread closes the output stream when its done.readFrom - the stream to read the data fromwriteTo - the stream to write the data topublic static void copy(java.io.InputStream in,
java.io.OutputStream out,
int bufferSize)
throws java.io.IOException
in to out using a buffer with the given bufferSize.in - the stream to copy bytes fromout - the stream to copy bytes tobufferSize - the buffer for storing the bytes between reading and writingjava.io.IOException - if something goes wrong during writing/readingpublic static void copy(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
in - the stream to copy bytes fromout - the stream to copy bytes tojava.io.IOException - if something goes wrong during writing/reading