Added in API level 9

InflaterOutputStream

open class InflaterOutputStream : FilterOutputStream
kotlin.Any
   ↳ java.io.OutputStream
   ↳ java.io.FilterOutputStream
   ↳ java.util.zip.InflaterOutputStream

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.

InflaterOutputStream(out: OutputStream!, infl: Inflater!, bufLen: Int)

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
write(b: ByteArray!, off: Int, len: Int)

Writes an array of bytes to the uncompressed output stream.

open Unit
write(b: Int)

Writes a byte to the uncompressed output stream.

Inherited functions
Properties
ByteArray!

Output buffer for writing uncompressed data.

Inflater!

Decompressor for this stream.

Inherited properties

Public constructors

InflaterOutputStream

Added in API level 9
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

Added in API level 9
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

Added in API level 9
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

Added in API level 9
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

Added in API level 9
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

Added in API level 9
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

Added in API level 9
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

Added in API level 9
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

Added in API level 9
protected val buf: ByteArray!

Output buffer for writing uncompressed data.

inf

Added in API level 9
protected val inf: Inflater!

Decompressor for this stream.