|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.lucidviews.util.io.Streams
public class Streams
A collection of methods for manipualting data Stream
s.
Field Summary | |
---|---|
protected static int |
DEFAULT_BUFFER_SIZE
the default buffer size used to pipe data across I/O streams |
Constructor Summary | |
---|---|
protected |
Streams()
Suppresses default constructor, ensuring non-instantiability. |
Method Summary | |
---|---|
static void |
close(InputStream stream)
Close an input stream. |
static void |
close(OutputStream stream)
Close an output stream. |
static boolean |
compare(InputStream stream1,
InputStream stream2)
Compare the content of two streams to determine if the data in both streams is the same. |
static boolean |
compare(InputStream stream1,
InputStream stream2,
int bufferSize)
Compare the content of two streams to determine if the data in both streams is the same. |
static void |
pipe(InputStream in,
OutputStream out)
Pipe data across I/O streams. |
static void |
pipe(InputStream in,
OutputStream out,
int bufferSize)
Pipe data across I/O streams. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_BUFFER_SIZE
Constructor Detail |
---|
protected Streams()
Method Detail |
---|
public static void pipe(InputStream in, OutputStream out) throws IOException
in
- the input streamout
- the output stream
IOException
- error reading or writing datapublic static void pipe(InputStream in, OutputStream out, int bufferSize) throws IOException
in
- the input streamout
- the output streambufferSize
- the size of the data buffer
IOException
- error reading or writing datapublic static void close(InputStream stream)
null
then this method has no action. Any
exception caused by closing the stream is silently handled.
stream
- the stream to be closedpublic static void close(OutputStream stream)
null
then this method has no action. Any
exception caused by closing the stream is silently handled.
stream
- the stream to be closedpublic static boolean compare(InputStream stream1, InputStream stream2) throws IOException
stream1
- a stream to be compared to the second streamstream2
- a stream to be compared to the first stream
true
if the binary content of both streams match
exactly
IOException
- error reading data from the streamspublic static boolean compare(InputStream stream1, InputStream stream2, int bufferSize) throws IOException
stream1
- a stream to be compared to the second streamstream2
- a stream to be compared to the first streambufferSize
- the size of the data buffer used when comparing binary
data
true
if the binary content of both streams match
exactly
IOException
- error reading data from the streams
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |