java.lang.Object
org.sejda.commons.util.IOUtils
Utility class with I/O related static methods
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidNull safe close of the givenCloseable.static voidcloseQuietly(Closeable closeable) Null safe close of the givenCloseablesuppressing any exception.static voidcloseQuietly(Closeable closeable, Consumer<IOException> consumer) Null safe close of the givenCloseablehanding the potential exception to the given consumerstatic voidcopy(InputStream input, OutputStream output) Copy the input stream data to the output streamstatic byte[]toByteArray(InputStream input)
-
Method Details
-
close
Null safe close of the givenCloseable.- Parameters:
closeable- to be closed- Throws:
IOException
-
closeQuietly
Null safe close of the givenCloseablesuppressing any exception.- Parameters:
closeable- to be closed
-
closeQuietly
Null safe close of the givenCloseablehanding the potential exception to the given consumer- Parameters:
closeable- to be closedconsumer- consumer for the potentialException. If null the exception is logged as a warning.
-
toByteArray
- Parameters:
input-- Returns:
- the content of the input stream as a byte[]
- Throws:
IOException
-
copy
Copy the input stream data to the output stream- Parameters:
input-output-- Throws:
IOException
-