Android
java.util.zip
public class

java.util.zip.GZIPOutputStream

java.lang.Object
java.io.OutputStream Closeable Flushable
java.io.FilterOutputStream
java.util.zip.DeflaterOutputStream
java.util.zip.GZIPOutputStream

The GZIPOutputStream class is used to write data to a stream in the GZIP storage format.

Summary

Fields

protected      CRC32  crc   
Fields inherited from class java.util.zip.DeflaterOutputStream
Fields inherited from class java.io.FilterOutputStream

Public Constructors

            GZIPOutputStream(OutputStream os)
Construct a new GZIPOutputStream to write data in GZIP format to the underlying stream.
            GZIPOutputStream(OutputStream os, int size)
Construct a new GZIPOutputStream to write data in GZIP format to the underlying stream.

Public Methods

          void  finish()
Indicates to the stream that all data has been written out, and any GZIP terminal data can now be output.
          void  write(byte[] buffer, int off, int nbytes)
Write up to nbytes of data from buf, starting at offset off, to the underlying stream in GZIP format.
Methods inherited from class java.util.zip.DeflaterOutputStream
Methods inherited from class java.io.FilterOutputStream
Methods inherited from class java.io.OutputStream
Methods inherited from class java.lang.Object
Methods inherited from interface java.io.Closeable
Methods inherited from interface java.io.Flushable

Details

Fields

protected CRC32 crc

Public Constructors

public GZIPOutputStream(OutputStream os)

Construct a new GZIPOutputStream to write data in GZIP format to the underlying stream.

Parameters

os OutputStream to write to

Throws

IOException

public GZIPOutputStream(OutputStream os, int size)

Construct a new GZIPOutputStream to write data in GZIP format to the underlying stream. Set the internal compression buffer to sise size.

Parameters

os OutputStream to write to
size Internal buffer size

Throws

IOException

Public Methods

public void finish()

Indicates to the stream that all data has been written out, and any GZIP terminal data can now be output.

Throws

IOException

public void write(byte[] buffer, int off, int nbytes)

Write up to nbytes of data from buf, starting at offset off, to the underlying stream in GZIP format.

Parameters

buffer Buffer of data to compress
off offset in buffer to extract data from
nbytes Number of bytes of data to compress and write

Throws

IOException
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56