java.util.zip

Class GZIPOutputStream

public class GZIPOutputStream extends DeflaterOutputStream

This filter stream is used to compress a stream into a "GZIP" stream. The "GZIP" format is described in RFC 1952.

Since: JDK 1.1

Field Summary
protected CRC32crc
CRC-32 value for uncompressed data
Constructor Summary
GZIPOutputStream(OutputStream out)
Creates a GZIPOutputStream with the default buffer size
GZIPOutputStream(OutputStream out, int size)
Creates a GZIPOutputStream with the specified buffer size
Method Summary
voidclose()
Writes remaining compressed output data to the output stream and closes it.
voidfinish()
voidwrite(byte[] buf, int off, int len)

Field Detail

crc

protected CRC32 crc
CRC-32 value for uncompressed data

Constructor Detail

GZIPOutputStream

public GZIPOutputStream(OutputStream out)
Creates a GZIPOutputStream with the default buffer size

Parameters: out The stream to read data (to be compressed) from

GZIPOutputStream

public GZIPOutputStream(OutputStream out, int size)
Creates a GZIPOutputStream with the specified buffer size

Parameters: out The stream to read compressed data from size Size of the buffer to use

Method Detail

close

public void close()
Writes remaining compressed output data to the output stream and closes it.

finish

public void finish()

write

public void write(byte[] buf, int off, int len)