java.util.zip.InflaterInputStream
java.io.FilterInputStream
java.util.zip.GZIPInputStream, java.util.zip.ZipInputStream
None
New as of JDK 1.1
The InflaterInputStream class represents an InputStream with an associated Inflater. In other words, an InflaterInputStream wraps a regular input stream, so that data read from the stream is read from an underlying stream and decompressed. Two subclasses, GZIPInputStream and ZipInputStream, read compressed data in widely recognized formats.
public class java.util.zip.InflaterInputStream extends java.io.FilterInputStream { // Variables protected byte[] buf; protected Inflater inf; protected int len; // Constructors public InflaterInputStream(InputStream in); public InflaterInputStream(InputStream in, Inflater inf); public InflaterInputStream(InputStream in, Inflater inf, int size); // Public Instance Methods public int read(); public int read(byte[] b, int off, int len); public long skip(long n); // Protected Instance Methods protected void fill(); }
A buffer that holds the compressed data that is written to the underlying stream.
The Inflater that is used internally.
The amount of data that is in the input buffer.
The underlying input stream.
This constructor creates an InflaterInputStream that reads data from the given InputStream. Before being read, the data is decompressed by a default Inflater. The InflaterInputStream uses a decompression buffer with the default size of 512 bytes.
The underlying input stream.
The Inflater object.
This constructor creates an InflaterInputStream that reads data from the given InputStream. Before being read, the data is decompressed by the given Inflater. The InflaterInputStream uses a decompression buffer with the default size of 512 bytes.
The underlying input stream.
The Inflater object.
The size of the input buffer.
This constructor creates an InflaterInputStream that reads data from the given InputStream. Before being read, the data is decompressed by the given Inflater. The InflaterInputStream uses a decompression buffer of the given size.
The next uncompressed byte or -1 if the end of the stream is encountered.
If any kind of I/O error occurs.
FilterInputStream.read()
This method reads enough data from the underlying InputStream to return a byte of uncompressed data. The method blocks until enough data is available for decompression, the end of the stream is detected, or an exception is thrown.
An array of bytes to be filled from the stream.
An offset into the byte array.
The number of bytes to read.
The number of bytes read or -1 if the end of the stream is encountered immediately.
If any kind of I/O error occurs.
FilterInputStream.read(byte[], int, int)
This method reads enough data from the underlying InputStream to return len bytes of uncompressed data. The uncompressed data is placed into the given array starting at off. The method blocks until some data is available for decompression.
The actual number of bytes skipped.
If any kind of I/O error occurs.
FilterInputStream.skip()
This method skips over the specified number of uncompressed data bytes by reading data from the underlying InputStream and decompressing it.
If any kind of I/O error occurs.
This method fills the input buffer with compressed data from the underlying InputStream.
Method |
Inherited From |
Method |
Inherited From |
---|---|---|---|
available() |
FilterInputStream |
clone() |
Object |
close() |
FilterInputStream |
equals(Object) |
Object |
finalize() |
Object |
getClass() |
Object |
hashCode() |
Object |
mark(int) |
FilterInputStream |
markSupported() |
FilterInputStream |
notify() |
Object |
notifyAll() |
Object |
read() |
InflaterInputStream |
read(byte[]) |
FilterInputStream |
reset() |
FilterInputStream |
toString() |
Object |
wait() |
Object |
wait(long) |
Object |
wait(long, int) |
Object |
FilterInputStream, GZIPInputStream, Inflater, InputStream, IOException, ZipInputStream