java.lang.Object
nl.altindag.laleler.IOUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseSilently(AutoCloseable autoCloseable) static byte[]copyToByteArray(InputStream inputStream) static byte[]copyToByteArray(InputStream inputStream, Function<Exception, ? extends RuntimeException> exceptionHandler) private static voidcreateDirectoriesIfAbsent(Path absoluteFilePath) static StringgetContent(InputStream inputStream) static StringgetContent(InputStream inputStream, Function<Exception, ? extends RuntimeException> exceptionHandler) static InputStreamgetFileAsStream(Path path) static InputStreamgetFileAsStream(Path path, Function<Exception, ? extends RuntimeException> exceptionHandler) static InputStreamgetResourceAsStream(String name) static voidstatic voidwrite(Path path, byte[] data, Function<Exception, ? extends RuntimeException> exceptionHandler) static voidwrite(Path path, Consumer<OutputStream> consumer) static voidwrite(Path path, Consumer<OutputStream> consumer, Function<Exception, ? extends RuntimeException> exceptionHandler)
-
Constructor Details
-
IOUtils
private IOUtils()
-
-
Method Details
-
getContent
-
getContent
public static String getContent(InputStream inputStream, Function<Exception, ? extends RuntimeException> exceptionHandler) -
copyToByteArray
-
copyToByteArray
public static byte[] copyToByteArray(InputStream inputStream, Function<Exception, ? extends RuntimeException> exceptionHandler) -
closeSilently
-
getResourceAsStream
-
getFileAsStream
-
getFileAsStream
public static InputStream getFileAsStream(Path path, Function<Exception, ? extends RuntimeException> exceptionHandler) -
write
-
write
public static void write(Path path, byte[] data, Function<Exception, ? extends RuntimeException> exceptionHandler) -
write
-
write
public static void write(Path path, Consumer<OutputStream> consumer, Function<Exception, ? extends RuntimeException> exceptionHandler) -
createDirectoriesIfAbsent
- Throws:
IOException
-