Package io.milton.common
Class StreamUtils
- java.lang.Object
-
- io.milton.common.StreamUtils
-
public class StreamUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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
public static void close(OutputStream out)
-
close
public static void close(InputStream in)
-
-