Java in a Nutshell

Previous Chapter 31
The java.util.zip Package
Next
 

31.12 java.util.zip.InflaterInputStream (JDK 1.1)

This class is a subclass of java.io.FilterInputStream; it reads a specified stream of compressed input data (typically one that was written with DeflaterOutputStream or a subclass) and "filters" that data by uncompressing ("inflating") it. To create an InflaterInputStream, you must specify the input stream it is to read from, and also an Inflater object that is to perform the uncompresssion. Once an InflaterInputStream is created, the read() and skip() methods are the same as those of other input streams.

Note that the InflaterInputStream uncompresses raw data. Applications often prefer one of its subclasses, GZIPInputStream or ZipInputStream, which work with compressed data written in the standard gzip and PKZip file formats.

public class InflaterInputStream extends FilterInputStream {
    // Public Constructors
            public InflaterInputStream(InputStream in, Inflater inf, int size);
            public InflaterInputStream(InputStream in, Inflater inf);
            public InflaterInputStream(InputStream in);
    // Protected Instance Variables
            protected byte[] buf;
            protected Inflater inf;
            protected int len;
    // Public Instance Methods
            public int read() throws IOException;  // Overrides FilterInputStream
            public int read(byte[] b, int off, int len) throws IOException;  // Overrides FilterInputStream
            public long skip(long n) throws IOException;  // Overrides FilterInputStream
    // Protected Instance Methods
            protected void fill() throws IOException;
}

Hierarchy:

Object->InputStream->FilterInputStream->InflaterInputStream

Extended By:

GZIPInputStream, ZipInputStream


Previous Home Next
java.util.zip.Inflater (JDK 1.1) Book Index java.util.zip.ZipEntry (JDK 1.1)

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java