Javazip 简明教程

java.util.zip - DeflaterInputStream Class

Introduction

java.util.zip.DeflaterInputStream 类实现用于以“压缩”压缩格式压缩数据的输入流过滤器。

The java.util.zip.DeflaterInputStream class implements an input stream filter for compressing data in the "deflate" compression format.

Class Declaration

以下为 java.util.zip.DeflaterInputStream 类的声明 −

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

public class DeflaterInputStream
   extends FilterInputStream

Fields

以下为 java.util.zip.DeflaterInputStream 类的字段 −

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

  1. protected byte[] buf − Input buffer for reading compressed data.

  2. protected Deflater def − Compressor for this stream.

Constructors

Sr.No.

Constructor & Description

1

DeflaterInputStream(InputStream in) Creates a new input stream with a default compressor and buffer size.

2

DeflaterInputStream(InputStream in, Deflater defl) Creates a new input stream with the specified compressor and a default buffer size.

3

DeflaterInputStream(InputStream in, Deflater defl, int bufLen) Creates a new input stream with the specified compressor and buffer size.

Class Methods

Sr.No.

Method & Description

1

int available()Returns 0 after EOF has been reached, otherwise always return 1.

2

void close()Closes this input stream and its underlying input stream, discarding any pending uncompressed data.

3

int read()Reads a single byte of compressed data from the input stream.

4

int read(byte[] b, int off, int len)Reads compressed data into a byte array.

5

long skip(long n)Skips over and discards data from the input stream.

Methods Inherited

此类从以下类中继承方法:

This class inherits methods from the following classes −

  1. java.io.FilterInputStream

  2. java.lang.Object