| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class DeflaterInputStream extends FilterInputStream
Implements an input stream filter for compressing data in the "deflate" compression format.
Field Summary | |
---|---|
protected byte[] |
buf
Input buffer for reading compressed data. |
protected Deflater |
def
Compressor for this stream. |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
Creates a new input stream with a default compressor and buffer size. |
|
DeflaterInputStream(InputStream in, Deflater defl) Creates a new input stream with the specified compressor and a default buffer size. |
|
DeflaterInputStream(InputStream in, Deflater defl, int bufLen) Creates a new input stream with the specified compressor and buffer size. |
Method Summary | |
---|---|
int |
Returns 0 after EOF has been reached, otherwise always return 1. |
void |
close() Closes this input stream and its underlying input stream, discarding any pending uncompressed data. |
void |
mark(int limit) This operation is not supported. |
boolean |
Always returns because this input stream does not support the java.util.zip.DeflaterInputStream.mark and java.util.zip.DeflaterInputStream.reset methods. |
int |
read() Reads a single byte of compressed data from the input stream. |
int |
read(byte[] b, int off, int len) Reads compressed data into a byte array. |
void |
reset() This operation is not supported. |
long |
skip(long n) Skips over and discards data from the input stream. |
Methods inherited from class java.io.FilterInputStream |
---|
available, close, mark, markSupported, read, read, read, reset, skip |
Methods inherited from class java.io.InputStream |
---|
available, close, mark, markSupported, read, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final byte[] buf
protected final Deflater def
Constructor Detail |
---|
public DeflaterInputStream(InputStream in)
in
- input stream to read the uncompressed data topublic DeflaterInputStream(InputStream in, Deflater defl)
in
- input stream to read the uncompressed data todefl
- compressor ("deflater") for this streampublic DeflaterInputStream(InputStream in, Deflater defl, int bufLen)
in
- input stream to read the uncompressed data todefl
- compressor ("deflater") for this streambufLen
- compression buffer sizeMethod Detail |
---|
public int available() throws IOException
Programs should not count on this method to return the actual number of bytes that could be read without blocking
available
in class FilterInputStream
IOException
- if an I/O error occurs or if this stream is
already closedpublic void close() throws IOException
close
in class FilterInputStream
IOException
- if an I/O error occurspublic void mark(int limit)
mark
in class FilterInputStream
limit
- maximum bytes that can be read before invalidating the position markerpublic boolean markSupported()
markSupported
in class FilterInputStream
public int read() throws IOException
read
in class FilterInputStream
IOException
- if an I/O error occurs or if this stream is
already closedpublic int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
b
- buffer into which the data is readoff
- starting offset of the data within {@code b}len
- maximum number of compressed bytes to read into {@code b}IOException
- if an I/O error occurs or if this input stream is
already closedpublic void reset() throws IOException
reset
in class FilterInputStream
IOException
- always thrownpublic long skip(long n) throws IOException
skip
in class FilterInputStream
n
- number of bytes to be skippedIOException
- if an I/O error occurs or if this stream is
already closed
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |