public class IOUtils extends Object
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
copy(InputStream input,
OutputStream output)
Copy bytes from an
InputStream to an OutputStream. |
static long |
copyLarge(InputStream input,
OutputStream output)
Copy bytes from a large (over 2GB)
InputStream to an OutputStream. |
public static long copyLarge(InputStream input, OutputStream output) throws IOException
InputStream to an OutputStream.
This method buffers the input internally, so there is no need to use a BufferedInputStream.
input - the InputStream to read fromoutput - the OutputStream to write toNullPointerException - if the input or output is nullIOException - if an I/O error occurspublic static int copy(InputStream input, OutputStream output) throws IOException
InputStream to an OutputStream.
This method buffers the input internally, so there is no need to use a BufferedInputStream.
Large streams (over 2GB) will return a bytes copied value of -1 after the copy has completed since the correct number of bytes cannot be
returned as an int. For large streams use the copyLarge(InputStream, OutputStream) method.
input - the InputStream to read fromoutput - the OutputStream to write toNullPointerException - if the input or output is nullIOException - if an I/O error occursCopyright © 2012. All Rights Reserved.