Name

GZIPOutputStream

Synopsis

This class is a subclass of DeflaterOutputStream that compresses and writes data using the gzip file format. To create a GZIPOutputStream, specify the OutputStream to write to and, optionally, a size for the internal compression buffer. Once the GZIPOutputStream is created, you can use the write( ) and close( ) methods as you would any output stream.

java.util.zip.GZIPOutputStream

Figure 16-141. java.util.zip.GZIPOutputStream

public class GZIPOutputStream extends DeflaterOutputStream {
// Public Constructors
     public GZIPOutputStream(java.io.OutputStream out) throws java.io.IOException;  
     public GZIPOutputStream(java.io.OutputStream out, int size) throws java.io.IOException;  
// Public Methods Overriding DeflaterOutputStream
     public void finish( ) throws java.io.IOException;  
     public void write(byte[ ] buf, int off, int len) throws java.io.IOException;     synchronized
                  // Protected Instance Fields
     protected CRC32 crc;  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.