InflaterOutputStream
open class InflaterOutputStream : FilterOutputStream
Implements an output stream filter for uncompressing data stored in the "deflate" compression format.
Summary
Public constructors |
Creates a new output stream with a default decompressor and buffer size.
|
Creates a new output stream with the specified decompressor and a default buffer size.
|
Creates a new output stream with the specified decompressor and buffer size.
|
Public methods |
open Unit |
Writes any remaining uncompressed data to the output stream and closes the underlying output stream.
|
open Unit |
Finishes writing uncompressed data to the output stream without closing the underlying stream.
|
open Unit |
Flushes this output stream, forcing any pending buffered output bytes to be written.
|
open Unit |
Writes an array of bytes to the uncompressed output stream.
|
open Unit |
Writes a byte to the uncompressed output stream.
|
Inherited functions |
From class OutputStream
OutputStream! |
nullOutputStream()
Returns a new OutputStream which discards all bytes. The returned stream is initially open. The stream is closed by calling the close() method. Subsequent calls to close() have no effect.
While the stream is open, the write(int) , write(byte[]) , and write(byte[], int, int) methods do nothing. After the stream has been closed, these methods all throw IOException .
The flush() method does nothing.
|
|
From class FilterOutputStream
Unit |
write(b: ByteArray!)
Writes b.length bytes to this output stream.
The write method of FilterOutputStream calls its write method of three arguments with the arguments b , 0 , and b.length .
Note that this method does not call the one-argument write method of its underlying output stream with the single argument b .
|
|
Properties |
ByteArray! |
Output buffer for writing uncompressed data.
|
Inflater! |
Decompressor for this stream.
|
Public constructors
InflaterOutputStream
InflaterOutputStream(out: OutputStream!)
Creates a new output stream with a default decompressor and buffer size.
Parameters |
out |
OutputStream!: output stream to write the uncompressed data to |
Exceptions |
java.lang.NullPointerException |
if out is null |
InflaterOutputStream
InflaterOutputStream(
out: OutputStream!,
infl: Inflater!)
Creates a new output stream with the specified decompressor and a default buffer size.
Parameters |
out |
OutputStream!: output stream to write the uncompressed data to |
infl |
Inflater!: decompressor ("inflater") for this stream |
Exceptions |
java.lang.NullPointerException |
if out or infl is null |
InflaterOutputStream
InflaterOutputStream(
out: OutputStream!,
infl: Inflater!,
bufLen: Int)
Creates a new output stream with the specified decompressor and buffer size.
Parameters |
out |
OutputStream!: output stream to write the uncompressed data to |
infl |
Inflater!: decompressor ("inflater") for this stream |
bufLen |
Int: decompression buffer size |
Exceptions |
java.lang.IllegalArgumentException |
if bufLen <= 0 |
java.lang.NullPointerException |
if out or infl is null |
Public methods
close
open fun close(): Unit
Writes any remaining uncompressed data to the output stream and closes the underlying output stream.
Exceptions |
java.lang.Exception |
if this resource cannot be closed |
java.io.IOException |
if an I/O error occurs |
finish
open fun finish(): Unit
Finishes writing uncompressed data to the output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.
Exceptions |
java.io.IOException |
if an I/O error occurs or this stream is already closed |
flush
open fun flush(): Unit
Flushes this output stream, forcing any pending buffered output bytes to be written.
Exceptions |
java.io.IOException |
if an I/O error occurs or this stream is already closed |
write
open fun write(
b: ByteArray!,
off: Int,
len: Int
): Unit
Writes an array of bytes to the uncompressed output stream.
Parameters |
b |
ByteArray!: buffer containing compressed data to decompress and write to the output stream |
off |
Int: starting offset of the compressed data within b |
len |
Int: number of bytes to decompress from b |
Exceptions |
java.io.IOException |
if an I/O error occurs or this stream is already closed |
java.lang.IndexOutOfBoundsException |
if off < 0 , or if len < 0 , or if len > b.length - off |
java.lang.NullPointerException |
if b is null |
java.util.zip.ZipException |
if a compression (ZIP) format error occurs |
write
open fun write(b: Int): Unit
Writes a byte to the uncompressed output stream.
Parameters |
b |
Int: a single byte of compressed data to decompress and write to the output stream |
Exceptions |
java.io.IOException |
if an I/O error occurs or this stream is already closed |
java.util.zip.ZipException |
if a compression (ZIP) format error occurs |
Properties
buf
protected val buf: ByteArray!
Output buffer for writing uncompressed data.
inf
protected val inf: Inflater!
Decompressor for this stream.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]