com.mot.iden.zip
Class GZIPOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bycom.mot.iden.zip.FilterOutputStream
          extended bycom.mot.iden.zip.DeflaterOutputStream
              extended bycom.mot.iden.zip.GZIPOutputStream

public class GZIPOutputStream
extends DeflaterOutputStream

This class implements a stream filter for writing compressed data in the GZIP file format.


MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© Copyright 2001-2003 Motorola, Inc. All Rights Reserved.


Field Summary
protected  CRC32 crc
          CRC-32 of uncompressed data.
 
Fields inherited from class com.mot.iden.zip.DeflaterOutputStream
buf, def, usesDefaultDeflater
 
Fields inherited from class com.mot.iden.zip.FilterOutputStream
out
 
Constructor Summary
GZIPOutputStream(java.io.OutputStream out)
          Creates a new output stream with a default buffer size.
GZIPOutputStream(java.io.OutputStream out, int size)
          Creates a new output stream with the specified buffer size.
 
Method Summary
 void close()
          Writes remaining compressed data to the output stream and closes the underlying stream.
 void finish()
          Finishes writing compressed data to the output stream without closing the underlying stream.
 void write(byte[] buf, int off, int len)
          Writes array of bytes to the compressed output stream.
 
Methods inherited from class com.mot.iden.zip.DeflaterOutputStream
deflate, write
 
Methods inherited from class com.mot.iden.zip.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
CRC-32 of uncompressed data.

Constructor Detail

GZIPOutputStream

public GZIPOutputStream(java.io.OutputStream out,
                        int size)
                 throws java.io.IOException
Creates a new output stream with the specified buffer size.

Parameters:
out - the output stream
size - the output buffer size
Throws:
java.io.IOException - If an I/O error has occurred.
java.lang.IllegalArgumentException - if size is <= 0

GZIPOutputStream

public GZIPOutputStream(java.io.OutputStream out)
                 throws java.io.IOException
Creates a new output stream with a default buffer size.

Parameters:
out - the output stream
Throws:
java.io.IOException - If an I/O error has occurred.
Method Detail

write

public void write(byte[] buf,
                  int off,
                  int len)
           throws java.io.IOException
Writes array of bytes to the compressed output stream. This method will block until all the bytes are written.

Overrides:
write in class DeflaterOutputStream
Parameters:
buf - the data to be written
off - the start offset of the data
len - the length of the data
Throws:
java.io.IOException - If an I/O error has occurred.

finish

public void finish()
            throws java.io.IOException
Finishes writing compressed data to the output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.

Overrides:
finish in class DeflaterOutputStream
Throws:
java.io.IOException - if an I/O error has occurred

close

public void close()
           throws java.io.IOException
Writes remaining compressed data to the output stream and closes the underlying stream.

Overrides:
close in class DeflaterOutputStream
Throws:
java.io.IOException - if an I/O error has occurred