|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ops4j.io.StreamUtils
public final class StreamUtils
Method Summary | |
---|---|
static boolean |
compareStreams(java.io.InputStream in1,
java.io.InputStream in2)
Compares if two streams are identical in their contents. |
static void |
copyReaderToStream(java.io.Reader in,
java.io.OutputStream out,
java.lang.String encoding,
boolean close)
Copies the content of the Reader to the provided OutputStream using the provided encoding. |
static void |
copyReaderToWriter(java.io.Reader input,
java.io.Writer output,
boolean close)
Copies the Reader to the Writer. |
static void |
copyStream(java.io.InputStream src,
java.io.OutputStream dest,
boolean closeStreams)
Copy a stream. |
static void |
copyStream(StreamMonitor monitor,
java.net.URL sourceURL,
int expected,
java.io.InputStream source,
java.io.OutputStream destination,
boolean closeStreams)
Copy a stream. |
static void |
copyStreamToWriter(java.io.InputStream in,
java.io.Writer out,
java.lang.String encoding,
boolean close)
Copies an InputStream to a Writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void copyStream(java.io.InputStream src, java.io.OutputStream dest, boolean closeStreams) throws java.io.IOException, NullArgumentException
src
- the source input streamdest
- the destination output streamcloseStreams
- TRUE if the streams should be closed on completion
java.io.IOException
- if an IO error occurs
NullArgumentException
- if either the src or dest arguments are null.public static void copyStream(StreamMonitor monitor, java.net.URL sourceURL, int expected, java.io.InputStream source, java.io.OutputStream destination, boolean closeStreams) throws java.io.IOException, NullArgumentException
sourceURL
- the source urlexpected
- the expected size in bytessource
- the source input streamdestination
- the destination output streamcloseStreams
- TRUE if the streams should be closed on completionmonitor
- The StreamMonitor to report progress to.
java.io.IOException
- if an IO error occurs
NullArgumentException
- if either the src or dest arguments are null.public static boolean compareStreams(java.io.InputStream in1, java.io.InputStream in2) throws java.io.IOException
in1
- The first stream.in2
- The second stream.
java.io.IOException
- If an underlying I/O problem occured.public static void copyReaderToWriter(java.io.Reader input, java.io.Writer output, boolean close) throws java.io.IOException
input
- The input characters.output
- The destination of the characters.close
- true if the reader and writer should be closed after the operation is completed.
java.io.IOException
- If an underlying I/O problem occured.public static void copyStreamToWriter(java.io.InputStream in, java.io.Writer out, java.lang.String encoding, boolean close) throws java.io.IOException
in
- The input byte stream of data.out
- The Writer to receive the streamed data as characters.encoding
- The encoding used in the byte stream.close
- true if the Reader and OutputStream should be closed after the completion.
java.io.IOException
- If an underlying I/O Exception occurs.public static void copyReaderToStream(java.io.Reader in, java.io.OutputStream out, java.lang.String encoding, boolean close) throws java.io.IOException
in
- The character data to convert.out
- The OutputStream to send the data to.encoding
- The character encoding that should be used for the byte stream.close
- true if the Reader and OutputStream should be closed after the completion.
java.io.IOException
- If an underlying I/O Exception occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |