- GZIPInputStream Class



The class implements a stream filter for reading compressed data in the GZIP file format.

Class declaration

Following is the declaration for class −

public class GZIPInputStream
   extends InflaterInputStream


Following are the fields for class −

  • protected CRC32 crc − CRC-32 for uncompressed data.

  • protected boolean eos − Indicates end of input stream.

  • static int GZIP_MAGIC − GZIP header magic number.


Sr.No. Constructor & Description

GZIPInputStream(InputStream in)

Creates a new input stream with a default buffer size.


GZIPInputStream(InputStream in, int size)

Creates a new input stream with the specified buffer size.

Class methods

Sr.No. Method & Description
1 void close()

Closes this input stream and releases any system resources associated with the stream.

2 int read(byte[] buf, int off, int len)

Reads uncompressed data into an array of bytes.

Methods inherited

This class inherits methods from the following classes −

  • java.lang.Object