public class IOUtils
extends java.lang.Object
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanup(org.slf4j.Logger log,
java.io.Closeable... closeables)
Close the Closeable objects and ignore any
IOException or
null pointers. |
static void |
closeStream(java.io.Closeable stream)
Closes the stream ignoring
IOException. |
static void |
copyBytes(java.io.InputStream in,
java.io.OutputStream out,
int buffSize)
Copies from one stream to another.
|
static void |
copyBytes(java.io.InputStream in,
java.io.OutputStream out,
int buffSize,
boolean close)
Copies from one stream to another.
|
public static void closeStream(java.io.Closeable stream)
IOException. Must only be called in
cleaning up from exception handlers.stream - the Stream to closepublic static void cleanup(org.slf4j.Logger log,
java.io.Closeable... closeables)
IOException or
null pointers. Must only be used for cleanup in exception handlers.log - the log to record problems to at debug level. Can be null.closeables - the objects to closepublic static void copyBytes(java.io.InputStream in,
java.io.OutputStream out,
int buffSize,
boolean close)
throws java.io.IOException
in - InputStrem to read fromout - OutputStream to write tobuffSize - the size of the bufferclose - whether or not close the InputStream and OutputStream at the
end. The streams are closed in the finally clause.java.io.IOExceptionpublic static void copyBytes(java.io.InputStream in,
java.io.OutputStream out,
int buffSize)
throws java.io.IOException
in - InputStrem to read fromout - OutputStream to write tobuffSize - the size of the bufferjava.io.IOExceptionCopyright © 2016 The Apache Software Foundation