Build 1.0_r1(from source)

java.util.zip
Class GZIPOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.util.zip.DeflaterOutputStream
              extended by java.util.zip.GZIPOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class GZIPOutputStream
extends DeflaterOutputStream

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


Field Summary
protected  CRC32 crc
           
 
Fields inherited from class java.util.zip.DeflaterOutputStream
buf, BUF_SIZE, def, done
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
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.
 
Method Summary
 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
close, deflate, write
 
Methods inherited from class java.io.FilterOutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crc

protected CRC32 crc
Constructor Detail

GZIPOutputStream

public GZIPOutputStream(OutputStream os)
                 throws IOException
Construct a new GZIPOutputStream to write data in GZIP format to the underlying stream.

Parameters:
os - OutputStream to write to
Throws:
IOException

GZIPOutputStream

public GZIPOutputStream(OutputStream os,
                        int size)
                 throws IOException
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
Method Detail

finish

public void finish()
            throws IOException
Indicates to the stream that all data has been written out, and any GZIP terminal data can now be output.

Overrides:
finish in class DeflaterOutputStream
Throws:
IOException - If an error occurs.

write

public void write(byte[] buffer,
                  int off,
                  int nbytes)
           throws IOException
Write up to nbytes of data from buf, starting at offset off, to the underlying stream in GZIP format.

Overrides:
write in class DeflaterOutputStream
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 - If an error occurs attempting to write to this FilterOutputStream.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature