| java.lang.Object java.io.OutputStream java.io.FilterOutputStream java.util.zip.DeflaterOutputStream
All known Subclasses: java.util.zip.ZipOutputStream, java.util.zip.GZIPOutputStream,
DeflaterOutputStream | public class DeflaterOutputStream extends FilterOutputStream (Code) | | The DeflaterOutputStream class implements a stream filter for the writing of
compressed data to a stream. Compression is performed by an instance of
Deflater.
|
Method Summary | |
public void | close() Writes any unwritten compressed data to the underlying stream, the closes
all underlying streams. | protected void | deflate() Compress the data in the input buffer and write it to the underlying
stream. | public void | finish() Write any unwritten data to the underlying stream. | public void | write(int i) | public void | write(byte[] buffer, int off, int nbytes) Compress data from a buffer and write it to the underlying stream. |
BUF_SIZE | final static int BUF_SIZE(Code) | | |
DeflaterOutputStream | public DeflaterOutputStream(OutputStream os, Deflater def)(Code) | | Constructs a new DeflaterOutputStream instance using os as the underlying
stream. The provided Deflater instance will be used to compress data.
Parameters: os - OutputStream to receive compressed data Parameters: def - Deflater to perform compression |
DeflaterOutputStream | public DeflaterOutputStream(OutputStream os)(Code) | | Constructs a new DeflaterOutputStream instance using os as the underlying
stream.
Parameters: os - OutputStream to receive compressed data |
DeflaterOutputStream | public DeflaterOutputStream(OutputStream os, Deflater def, int bsize)(Code) | | Constructs a new DeflaterOutputStream instance using os as the underlying
stream. The provided Deflater instance will be used to compress data. The
internal buffer for storing compressed data will be of size bsize.
Parameters: os - OutputStream to receive compressed data Parameters: def - Deflater to perform compression Parameters: bsize - size of internal compression buffer |
close | public void close() throws IOException(Code) | | Writes any unwritten compressed data to the underlying stream, the closes
all underlying streams. This stream can no longer be used after close()
has been called.
exception: java.io.IOException - If an error occurs during close. |
deflate | protected void deflate() throws IOException(Code) | | Compress the data in the input buffer and write it to the underlying
stream.
exception: java.io.IOException - If an error occurs during deflation. |
finish | public void finish() throws IOException(Code) | | Write any unwritten data to the underlying stream. Do not close the
stream. This allows subsequent Deflater's to write to the same stream.
This Deflater cannot be used again.
exception: java.io.IOException - If an error occurs. |
write | public void write(byte[] buffer, int off, int nbytes) throws IOException(Code) | | Compress data from a buffer and write it to the underlying stream.
Parameters: buffer - Buffer of data to compress Parameters: off - offset in buffer to extract data from Parameters: nbytes - Number of bytes of data to compress and write exception: IOException - If an error occurs during writing. |
|
|