public final class IOHelper extends Object
Modifier and Type | Method and Description |
---|---|
static void |
close(AutoCloseable closable)
Close the AutoCloseable and log any exception that might be thrown.
|
static void |
close(Closeable closeable)
Close the closable and ignore but log thrown exceptions.
|
static long |
write(InputStream in,
OutputStream out,
long maxLength)
Write the data of the input stream to the output stream
|
public static void close(AutoCloseable closable)
closable
- The closable to close. Can be null.public static void close(Closeable closeable)
IOUtils.closeQuietly(Closeable)
if you don't need any logging.closeable
- The closable to close. Can be null.public static long write(InputStream in, OutputStream out, long maxLength) throws IOException
in
- the in streamout
- the out streammaxLength
- Throws an MaxLengthReachedException
when the inputstream is larger than
the maximal allowed length. Use a value <= 0 (zero) for no limit.IOException
- in case of an exceptionCopyright © 2019 Communote team. All rights reserved.