public final class IOUtils
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static void |
closeQuietly(java.io.Closeable closeable) |
Null safe close of the given
Closeable suppressing any exception. |
static long |
copy(java.io.InputStream input,
java.io.OutputStream output) |
Copies all the contents from the given input stream to the given output stream.
|
static long |
populateBuffer(java.io.InputStream in,
byte[] buffer) |
Populates the given buffer with data read from the input stream.
|
static byte[] |
toByteArray(java.io.InputStream in) |
Reads the input stream and returns its contents as a byte array.
|
public static byte[] toByteArray(java.io.InputStream in)
throws java.io.IOException
in - the input stream to read from.java.io.IOException - if an I/O error occurspublic static long copy(java.io.InputStream input,
java.io.OutputStream output)
throws java.io.IOException
input - the input streamoutput - the output streamjava.io.IOException - if an I/O error occurspublic static long populateBuffer(java.io.InputStream in,
byte[] buffer)
throws java.io.IOException
in - the input stream to read frombuffer - the buffer to filljava.io.IOException - if an I/O error occurspublic static void closeQuietly(java.io.Closeable closeable)
Closeable suppressing any exception.closeable - to be closedCopyright © 2002–2018. All rights reserved.