Build 1.0_r1(from source)

java.util.zip
Class GZIPInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.util.zip.InflaterInputStream
              extended by java.util.zip.GZIPInputStream
All Implemented Interfaces:
Closeable

public class GZIPInputStream
extends InflaterInputStream

The GZIPInputStream class is used to read data stored in the GZIP format.


Field Summary
protected  CRC32 crc
           
protected  boolean eos
           
static int GZIP_MAGIC
           
 
Fields inherited from class java.util.zip.InflaterInputStream
buf, BUF_SIZE, closed, eof, inf, len, nativeEndBufSize
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
GZIPInputStream(InputStream is)
          Construct a GZIPInputStream to read from GZIP data from the underlying stream
GZIPInputStream(InputStream is, int size)
          Construct a GZIPInputStream to read from GZIP data from the underlying stream.
 
Method Summary
 void close()
          Closes this stream and any underlying streams.
 int read(byte[] buffer, int off, int nbytes)
          Reads and decompresses GZIP data from the underlying stream into buf.
 
Methods inherited from class java.util.zip.InflaterInputStream
available, fill, mark, markSupported, read, reset, skip
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crc

protected CRC32 crc

eos

protected boolean eos

GZIP_MAGIC

public static final int GZIP_MAGIC
See Also:
Constant Field Values
Constructor Detail

GZIPInputStream

public GZIPInputStream(InputStream is)
                throws IOException
Construct a GZIPInputStream to read from GZIP data from the underlying stream

Parameters:
is - InputStream to read data from
Throws:
IOException

GZIPInputStream

public GZIPInputStream(InputStream is,
                       int size)
                throws IOException
Construct a GZIPInputStream to read from GZIP data from the underlying stream. Set the internal buffer size to size

Parameters:
is - InputStream to read data from
size - Internal read buffer size
Throws:
IOException
Method Detail

read

public int read(byte[] buffer,
                int off,
                int nbytes)
         throws IOException
Reads and decompresses GZIP data from the underlying stream into buf.

Overrides:
read in class InflaterInputStream
Parameters:
buffer - Buffer to receive data
off - Offset in buffer to store data
nbytes - Number of bytes to read
Returns:
Number of uncompressed bytes read
Throws:
IOException - If an error occurs reading

close

public void close()
           throws IOException
Closes this stream and any underlying streams.

Specified by:
close in interface Closeable
Overrides:
close in class InflaterInputStream
Throws:
IOException - If an error occurs closing the stream

Build 1.0_r1(from source)

Please submit a feedback, bug or feature