Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.util.zip

Class GZIPInputStream

java.lang.Object
|
+--java.io.InputStream
   |
   +--java.io.FilterInputStream
      |
      +--java.util.zip.InflaterInputStream
         |
         +--java.util.zip.GZIPInputStream


public class GZIPInputStream

extends InflaterInputStream

This filter stream is used to decompress a "GZIP" format stream. The "GZIP" format is described in RFC 1952.

Since:Author:

Field Summary

static intGZIP_MAGIC

The magic number found at the start of a GZIP stream.
java.util.zip.CRC32crc

The CRC-32 checksum value for uncompressed data.
booleaneos

Indicates whether or not the end of the stream has been reached.

Constructor Summary

GZIPInputStream(java.io.InputStream in)

Creates a GZIPInputStream with the default buffer size.
GZIPInputStream(java.io.InputStream in, int size)

Creates a GZIPInputStream with the specified buffer size.

Method Summary

voidclose()

Closes the input stream.
intread(byte[] buf, int offset, int len)

Reads in GZIP-compressed data and stores it in uncompressed form into an array of bytes.

Field Details

GZIP_MAGIC

public static final int GZIP_MAGIC

The magic number found at the start of a GZIP stream.


crc

protected CRC32 crc

The CRC-32 checksum value for uncompressed data.


eos

protected boolean eos

Indicates whether or not the end of the stream has been reached.


Constructor Details

GZIPInputStream

public GZIPInputStream(java.io.InputStream in)

Creates a GZIPInputStream with the default buffer size.

Parameters:

Throws:


GZIPInputStream

public GZIPInputStream(java.io.InputStream in, int size)

Creates a GZIPInputStream with the specified buffer size.

Parameters:

Throws:


Method Details

close

public void close()

Closes the input stream.

Throws:


read

public int read(byte[] buf, int offset, int len)

Reads in GZIP-compressed data and stores it in uncompressed form into an array of bytes. The method will block until either enough input data becomes available or the compressed stream reaches its end.

Parameters: