Name
DeflaterOutputStream
Synopsis
This class is a subclass of
java.io.FilterOutputStream; it filters a stream of
data by compressing (deflating) it and then writing the compressed
data to another output stream. To create a
DeflaterOutputStream, you must specify both the
stream it is to write to and a Deflater object 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 read data written
with a DeflaterOutputStream. A
DeflaterOutputStream writes raw compressed data;
applications often prefer one of its subclasses,
GZIPOutputStream or
ZipOutputStream, that wraps the raw compressed
data within a standard file format.
Figure 16-139. java.util.zip.DeflaterOutputStream
public class DeflaterOutputStream extends java.io.FilterOutputStream { // Public Constructors public DeflaterOutputStream(java.io.OutputStream out); public DeflaterOutputStream(java.io.OutputStream out, Deflater def); public DeflaterOutputStream(java.io.OutputStream out, Deflater def, int size); // Public Instance Methods public void finish( ) throws java.io.IOException; // Public Methods Overriding FilterOutputStream public void close( ) throws java.io.IOException; public void write(int ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access