java.lang.Object | |||
↳ | java.io.OutputStream | ||
↳ | java.io.FilterOutputStream | ||
↳ | java.util.zip.DeflaterOutputStream |
Known Direct Subclasses |
Known Indirect Subclasses |
This class provides an implementation of FilterOutputStream
that
compresses data using the DEFLATE algorithm. Basically it wraps the
Deflater
class and takes care of the buffering.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
buf | The buffer for the data to be written to. | ||||||||||
def | The deflater used. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.FilterOutputStream
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance with a default-constructed
Deflater .
| |||||||||||
Constructs a new instance with the given
Deflater .
| |||||||||||
Constructs a new instance with the given
Deflater and buffer size.
| |||||||||||
Constructs a new instance with the given flushing behavior (see
flush() ).
| |||||||||||
Constructs a new instance with the given
Deflater and
flushing behavior (see flush() ).
| |||||||||||
Constructs a new instance with the given
Deflater , buffer size, and
flushing behavior (see flush() ).
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Writes any unwritten compressed data to the underlying stream, the closes
all underlying streams.
| |||||||||||
Writes any unwritten data to the underlying stream.
| |||||||||||
Flushes the underlying stream.
| |||||||||||
Compresses
byteCount bytes of data from buf starting at
offset and writes it to the underlying stream.
| |||||||||||
Writes one byte to the target stream.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compress the data in the input buffer and write it to the underlying
stream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.FilterOutputStream
| |||||||||||
From class
java.io.OutputStream
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.io.Closeable
| |||||||||||
From interface
java.io.Flushable
| |||||||||||
From interface
java.lang.AutoCloseable
|
Constructs a new instance with a default-constructed Deflater
.
Constructs a new instance with the given Deflater
.
Constructs a new instance with the given Deflater
and buffer size.
Constructs a new instance with the given flushing behavior (see flush()
).
Constructs a new instance with the given Deflater
and
flushing behavior (see flush()
).
Constructs a new instance with the given Deflater
, buffer size, and
flushing behavior (see flush()
).
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.
IOException | If an error occurs while closing the data compression process. |
---|
Writes any unwritten data to the underlying stream. Does not close the stream.
IOException | If an error occurs. |
---|
Flushes the underlying stream. This flushes only the bytes that can be compressed at the highest level.
For deflater output streams constructed with the syncFlush
parameter set to true,
this first flushes all outstanding data so that it may be immediately read by its recipient.
Doing so may degrade compression but improve interactive behavior.
IOException |
---|
Compresses byteCount
bytes of data from buf
starting at
offset
and writes it to the underlying stream.
buffer | the buffer to write. |
---|---|
offset | the index of the first byte in buffer to write. |
byteCount | the number of bytes in buffer to write. |
IOException | If an error occurs during writing. |
---|
Writes one byte to the target stream. Only the low order byte of the
integer oneByte
is written.
i | the byte to be written. |
---|
IOException |
---|
Compress the data in the input buffer and write it to the underlying stream.
IOException | If an error occurs during deflation. |
---|