java.util.zip.DeflaterOutputStream (JDK 1.1)
This class is a subclass of java.io.FilterOutputStream; it "filters" a stream of data by compressing ("deflating") it and then writes the compressed data to another output stream. To create a DeflaterOutputStream, you must specify the stream that it is to write to, and also a Deflater object that is to perform the compression. You can set various options on the Deflater object to specify just what type of compression is to be performed. Once a DeflaterOutputStream is created, its write() and close() methods are the same as those of other output streams.
The InflaterInputStream class can be used to read data written with the DeflaterOutputStream.
Note that a DeflaterOutputStream writes raw compressed data; applications often prefer one of its subclasses, GZIPOutputStream or ZipOutputStream, which wraps the raw compressed data within a standard file format.
public classDeflaterOutputStreamextends FilterOutputStream { //Public ConstructorspublicDeflaterOutputStream(OutputStreamout, Deflaterdef, intsize); publicDeflaterOutputStream(OutputStreamout, Deflaterdef); publicDeflaterOutputStream(OutputStreamout); //Protected Instance Variablesprotected byte[]buf; protected Deflaterdef; //Public Instance Methodspublic voidclose() throws IOException; //Overrides FilterOutputStreampublic voidfinish() throws IOException; public voidwrite(intb) throws IOException; //Overrides FilterOutputStreampublic voidwrite(byte[]b, intoff, intlen) throws IOException; //Overrides FilterOutputStream//Protected Instance Methodsprotected voiddeflate() throws IOException; }
Hierarchy:
Object->OutputStream->FilterOutputStream->DeflaterOutputStream
Extended By:
GZIPOutputStream, ZipOutputStream