Module net.anwiba.commons.reference
Class IoUtilities
java.lang.Object
net.anwiba.commons.reference.utilities.IoUtilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IOExceptionasIOException(Throwable throwable) static IOExceptionstatic IOExceptionclose(IOException exception, AutoCloseable closeable) static IOExceptionclose(AutoCloseable closeable) static voidcloseAndThrow(Closeable closeable, Closeable other, Closeable... others) static booleancontentEquals(File file, File other) static ByteArrayInputStreamcopy(InputStream inputStream) static IOExceptionexecute(IOException exception, IBlock<IOException> block) static intmaximumLimitOfBytes(int contentLength) static intmaximumLimitOfBytes(long contentLength) static voidstatic voidpipe(InputStream inputStream, File file) static voidpipe(InputStream in, OutputStream out) static voidpipe(InputStream in, OutputStream out, int bufferSize) static voidpipe(InputStream in, OutputStream out, int bufferSize, long numberOfBytes) static voidstatic voidstatic voidstatic voidthrowIfNotEmpty(List<Throwable> throwables) static voidthrowIfNotNull(Throwable throwable) static byte[]toByteArray(InputStream inputStream) static StringtoString(InputStream inputStream, String contentEncoding) static StringtoString(InputStream inputStream, String contentEncoding, long numberOfBytes) static Stringstatic String
-
Constructor Details
-
IoUtilities
public IoUtilities()
-
-
Method Details
-
copy
- Throws:
IOException
-
pipe
- Throws:
IOException
-
pipe
- Throws:
IOException
-
pipe
public static void pipe(InputStream in, OutputStream out, int bufferSize, long numberOfBytes) throws IOException - Throws:
IOException
-
pipe
- Throws:
IOExceptionFileNotFoundException
-
pipe
- Throws:
IOException
-
pipe
- Throws:
IOException
-
pipe
public static void pipe(Readable in, Writer out, int bufferSize, long numberOfCharacters) throws IOException - Throws:
IOException
-
toString
- Throws:
IOException
-
toString
- Throws:
IOException
-
close
-
close
-
closeAndThrow
public static void closeAndThrow(Closeable closeable, Closeable other, Closeable... others) throws IOException - Throws:
IOException
-
close
-
throwIfNotNull
- Throws:
IOException
-
throwIfNotEmpty
- Throws:
IOException
-
asIOException
-
execute
-
toString
public static String toString(InputStream inputStream, String contentEncoding, long numberOfBytes) throws IOException - Throws:
IOException
-
toString
- Throws:
IOException
-
toByteArray
- Throws:
IOException
-
maximumLimitOfBytes
public static int maximumLimitOfBytes(long contentLength) -
maximumLimitOfBytes
public static int maximumLimitOfBytes(int contentLength) -
pipe
- Throws:
IOException
-
contentEquals
public static boolean contentEquals(File file, File other) throws FileNotFoundException, IOException - Throws:
FileNotFoundExceptionIOException
-