📜  java.util.zip-DeflaterOutputStream类

📅  最后修改于: 2020-11-14 10:52:33             🧑  作者: Mango


介绍

java.util.zip.DeflaterOutputStream类实现输出流过滤器,用于以“ deflate”压缩格式压缩数据。它还用作其他类型的压缩过滤器(例如GZIPOutputStream)的基础。

类声明

以下是java.util.zip.DeflaterOutputStream类的声明-

public class DeflaterOutputStream
   extends FilterOutputStream

领域

以下是java.util.zip.DeflaterOutputStream类的字段-

  • protected byte [] buf-用于写入压缩数据的输出缓冲区。

  • 受保护的Deflater def-此流的压缩器。

建设者

Sr.No. Constructor & Description
1

DeflaterOutputStream(OutputStream out)

Creates a new output stream with a default compressor and buffer size.

2

DeflaterOutputStream(OutputStream out, boolean syncFlush)

Creates a new output stream with a default compressor, a default buffer size and the specified flush mode.

3

DeflaterOutputStream(OutputStream out, Deflater def)

Creates a new output stream with the specified compressor and a default buffer size.

4

DeflaterOutputStream(OutputStream out, Deflater def, boolean syncFlush)

Creates a new output stream with the specified compressor, flush mode and a default buffer size.

5

DeflaterOutputStream(OutputStream out, Deflater def, int size)

Creates a new output stream with the specified compressor and buffer size.

6

DeflaterOutputStream(OutputStream out, Deflater def, int size, boolean syncFlush)

Creates a new output stream with the specified compressor, buffer size and flush mode.

类方法

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

Writes remaining compressed data to the output stream and closes the underlying stream.

2 void finish()

Finishes writing compressed data to the output stream without closing the underlying stream.

3 void flush()

Flushes the compressed output stream.

4 void write(byte[] b, int off, int len)

Writes an array of bytes to the compressed output stream.

5 void write(int b)

Writes a byte to the compressed output stream.

方法继承

此类从以下类继承方法-

  • java.io.FilterOutputStream
  • java.lang.Object

打印