Package io.milton.common
Class StreamUtils
java.lang.Object
io.milton.common.StreamUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(InputStream in) static voidclose(OutputStream out) static longreadTo(File inFile, OutputStream out, boolean closeOut) static longreadTo(InputStream in, File outFile, boolean closeIn) static longreadTo(InputStream in, OutputStream out) Copies data from in to out and DOES NOT close streamsstatic longreadTo(InputStream in, OutputStream out, boolean closeIn, boolean closeOut) Reads bytes from the input and writes them, completely, to the output.static longreadTo(InputStream in, OutputStream out, boolean closeIn, boolean closeOut, Long start, Long finish)
-
Method Details
-
readTo
public static long readTo(File inFile, OutputStream out, boolean closeOut) throws ReadingException, WritingException - Throws:
ReadingExceptionWritingException
-
readTo
public static long readTo(InputStream in, File outFile, boolean closeIn) throws ReadingException, WritingException - Throws:
ReadingExceptionWritingException
-
readTo
public static long readTo(InputStream in, OutputStream out) throws ReadingException, WritingException Copies data from in to out and DOES NOT close streams- Parameters:
in-out-- Returns:
- Throws:
com.bradmcevoy.io.ReadingExceptioncom.bradmcevoy.io.WritingExceptionReadingExceptionWritingException
-
readTo
public static long readTo(InputStream in, OutputStream out, boolean closeIn, boolean closeOut) throws ReadingException, WritingException Reads bytes from the input and writes them, completely, to the output. Closes both streams when finished depending on closeIn and closeOyt- Parameters:
in-out-closeIn-closeOut-- Returns:
- - number of bytes written
- Throws:
com.bradmcevoy.io.ReadingExceptioncom.bradmcevoy.io.WritingExceptionReadingExceptionWritingException
-
readTo
public static long readTo(InputStream in, OutputStream out, boolean closeIn, boolean closeOut, Long start, Long finish) throws ReadingException, WritingException - Throws:
ReadingExceptionWritingException
-
close
-
close
-