InflaterOutputStream created without
specifying a decompressor will create a decompressor
at construction time, and close the decompressor when the output stream
is closed or when finish() is called.
If a decompressor is specified when creating a InflaterOutputStream, it is the
responsibility of the caller to close the
decompressor after closing the output stream.
API Note
The close method should be called to release resources used by this
stream, either directly, or with the try-with-resources statement.
InflaterInputStream, DeflaterInputStream, DeflaterOutputStream
| Modifier and Type | Field and Description |
|---|---|
| protected final byte[] | buf
Output buffer for writing decompressed data. |
| private boolean | |
| private boolean | |
| protected final Inflater | inf
Decompressor for this stream. |
| private boolean | usesDefaultInflater
Default decompressor is used. |
| private final byte[] | wbuf
Temporary write buffer. |
| Access | Constructor and Description |
|---|---|
| public | InflaterOutputStream(OutputStream
output stream to write the decompressed data to out)Creates a new output stream and decompressor with a default buffer size. |
| public | InflaterOutputStream(OutputStream
output stream to write the decompressed data to out, Inflater decompressor ("inflater") for this stream infl)Creates a new output stream with the specified decompressor and a default buffer size. |
| public | InflaterOutputStream(OutputStream
output stream to write the decompressed data to out, Inflater decompressor ("inflater") for this stream infl, int decompression buffer size bufLen)Creates a new output stream with the specified decompressor and buffer size. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Writes any remaining decompressed data to the output stream and closes the underlying output stream. |
| private void | |
| public void | finish()
Writes any pending buffered decompressed data to the underlying output stream, without closing the underlying stream. |
| public void | flush()
Overrides java. Implements java. Flushes this output stream, writing any pending buffered decompressed data to the underlying output stream. |
| public void | write(int
a single byte of compressed data to decompress and write to
the output stream b)Overrides java. Writes a byte to the decompressed output stream. |
| public void | write(byte[]
buffer containing compressed data to decompress and write to
the output stream b, int starting offset of the compressed data within off, int bnumber of bytes to decompress from len)bOverrides java. Writes an array of bytes to the decompressed output stream. |
| buf | back to summary |
|---|---|
| protected final byte[] buf Output buffer for writing decompressed data. | |
| closed | back to summary |
|---|---|
| private boolean closed Hides java. true iff | |
| defaultInflaterClosed | back to summary |
|---|---|
| private boolean defaultInflaterClosed | |
| inf | back to summary |
|---|---|
| protected final Inflater inf Decompressor for this stream. | |
| usesDefaultInflater | back to summary |
|---|---|
| private boolean usesDefaultInflater Default decompressor is used. | |
| wbuf | back to summary |
|---|---|
| private final byte[] wbuf Temporary write buffer. | |
| InflaterOutputStream | back to summary |
|---|---|
| public InflaterOutputStream(OutputStream out) Creates a new output stream and decompressor with a default buffer size. The decompressor will be closed when this output stream is closed.
| |
| InflaterOutputStream | back to summary |
|---|---|
| public InflaterOutputStream(OutputStream out, Inflater infl) Creates a new output stream with the specified decompressor and a default buffer size. Closing this output stream will not close the given decompressor.
| |
| InflaterOutputStream | back to summary |
|---|---|
| public InflaterOutputStream(OutputStream out, Inflater infl, int bufLen) Creates a new output stream with the specified decompressor and buffer size. Closing this output stream will not close the given decompressor.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Writes any remaining decompressed data to the output stream and closes the underlying output stream. Implementation Specification If not already closed, this method calls
| |
| ensureOpen | back to summary |
|---|---|
| private void ensureOpen() throws IOException Checks to make sure that this stream has not been closed. | |
| finish | back to summary |
|---|---|
| public void finish() throws IOException Writes any pending buffered decompressed data to the underlying output stream, without closing the underlying stream. Implementation Specification This method calls
If this
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Flushes this output stream, writing any pending buffered decompressed data to the underlying output stream.
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Overrides java. Writes a byte to the decompressed output stream.
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Writes an array of bytes to the decompressed output stream.
| |