|
|||||||||
| 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(InputStream in1,
InputStream in2)
Compares if two streams are identical in their contents. |
static void |
copyReaderToStream(Reader in,
OutputStream out,
String encoding,
boolean close)
Copies the content of the Reader to the provided OutputStream using the provided encoding. |
static void |
copyReaderToWriter(Reader input,
Writer output,
boolean close)
Copies the Reader to the Writer. |
static void |
copyStream(InputStream src,
OutputStream dest,
boolean closeStreams)
Copy a stream. |
static void |
copyStream(StreamMonitor monitor,
URL sourceURL,
int expected,
InputStream source,
OutputStream destination,
boolean closeStreams)
Copy a stream. |
static void |
copyStreamToWriter(InputStream in,
Writer out,
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(InputStream src,
OutputStream dest,
boolean closeStreams)
throws IOException,
NullArgumentException
src - the source input streamdest - the destination output streamcloseStreams - TRUE if the streams should be closed on completion
IOException - if an IO error occurs
NullArgumentException - if either the src or dest arguments are null.
public static void copyStream(StreamMonitor monitor,
URL sourceURL,
int expected,
InputStream source,
OutputStream destination,
boolean closeStreams)
throws 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.
IOException - if an IO error occurs
NullArgumentException - if either the src or dest arguments are null.
public static boolean compareStreams(InputStream in1,
InputStream in2)
throws IOException
in1 - The first stream.in2 - The second stream.
IOException - If an underlying I/O problem occured.
public static void copyReaderToWriter(Reader input,
Writer output,
boolean close)
throws 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.
IOException - If an underlying I/O problem occured.
public static void copyStreamToWriter(InputStream in,
Writer out,
String encoding,
boolean close)
throws 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.
IOException - If an underlying I/O Exception occurs.
public static void copyReaderToStream(Reader in,
OutputStream out,
String encoding,
boolean close)
throws 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.
IOException - If an underlying I/O Exception occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||