Javazip 简明教程

java.util.zip - GZIPInputStream Class

Introduction

java.util.zip.GZIPInputStream 类实现一个流过滤器,用于读取 GZIP 文件格式中的压缩数据。

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

Class Declaration

这是 java.util.zip.GZIPInputStream 类声明 −

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

public class GZIPInputStream
   extends InflaterInputStream

Fields

以下是 java.util.zip.GZIPInputStream 类中的字段 −

Following are the fields for java.util.zip.GZIPInputStream class −

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

  2. protected boolean eos − Indicates end of input stream.

  3. static int GZIP_MAGIC − GZIP header magic number.

Constructors

Sr.No.

Constructor & Description

1

GZIPInputStream(InputStream in) Creates a new input stream with a default buffer size.

2

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 −

  1. java.util.zip.InflaterInputStream

  2. java.io.FilterInputStream

  3. java.lang.Object