edu.emory.mathcs.util.io
Class CompressedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
edu.emory.mathcs.util.io.CompressedInputStream
- public class CompressedInputStream
- extends java.io.FilterInputStream
Filter input stream that is able to decompress data compressed with
CompressedOutputStream
. Since the latter features strong
flush semantics, the two can be used as a transport for RMI or RPC.
Note that standard ZipOutputStream
and
GZIPOutputStream
are useless for this purpose due to
their insufficiently strong flushing semantics: they don't guarantee that
flush sends out all the data that was written so far, which leads to
deadlocks in request-response-based protocols.
- Version:
- 1.0
- Author:
- Dawid Kurzyniec
- See Also:
CompressedOutputStream
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary |
CompressedInputStream(java.io.InputStream in)
Creates a new compressed stream over a specified stream. |
CompressedInputStream(java.io.InputStream in,
int bufSize)
Creates a new compressed stream that reads from a specified stream and
uses specified buffer size. |
Method Summary |
int |
read()
|
int |
read(byte[] dest,
int off,
int len)
|
Methods inherited from class java.io.FilterInputStream |
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompressedInputStream
public CompressedInputStream(java.io.InputStream in)
- Creates a new compressed stream over a specified stream.
- Parameters:
in
- the input to read from
CompressedInputStream
public CompressedInputStream(java.io.InputStream in,
int bufSize)
- Creates a new compressed stream that reads from a specified stream and
uses specified buffer size.
- Parameters:
in
- the input to read frombufSize
- buffer size
read
public int read()
throws java.io.IOException
- Throws:
java.io.IOException
read
public int read(byte[] dest,
int off,
int len)
throws java.io.IOException
- Throws:
java.io.IOException