GZIPInputStream 

Introduction

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

Class Declaration

Following is the declaration for java.util.zip.GZIPInputStream class −

publicclassGZIPInputStreamextendsInflaterInputStream

Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career.

Fields

Following are the fields for java.util.zip.GZIPInputStream 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.

Constructors

Sr.No.Constructor & Description
1GZIPInputStream(InputStream in)Creates a new input stream with a default buffer size.
2GZIPInputStream(InputStream in, int size)Creates a new input stream with the specified buffer size.

Class Methods

Sr.No.Method & Description
1void close()Closes this input stream and releases any system resources associated with the stream.
2int 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.util.zip.InflaterInputStream
  • java.io.FilterInputStream
  • java.lang.Object

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *