Skip to content

Most visited

Recently visited

navigation
Added in API level 9

InflaterOutputStream

public class InflaterOutputStream
extends FilterOutputStream

java.lang.Object
   ↳ java.io.OutputStream
     ↳ java.io.FilterOutputStream
       ↳ java.util.zip.InflaterOutputStream


An OutputStream filter to decompress data. Callers write compressed data in the "deflate" format, and uncompressed data is written to the underlying stream.

Summary

Fields

protected final byte[] buf

protected final Inflater inf

Inherited fields

From class java.io.FilterOutputStream

Public constructors

InflaterOutputStream(OutputStream out)

Constructs an InflaterOutputStream with a new Inflater and an implementation-defined default internal buffer size.

InflaterOutputStream(OutputStream out, Inflater inf)

Constructs an InflaterOutputStream with the given Inflater and an implementation-defined default internal buffer size.

InflaterOutputStream(OutputStream out, Inflater inf, int bufferSize)

Constructs an InflaterOutputStream with the given Inflater and given internal buffer size.

Public methods

void close()

Writes remaining data into the output stream and closes the underlying output stream.

void finish()

Finishes writing current uncompressed data into the InflaterOutputStream without closing it.

void flush()

Ensures that all pending data is sent out to the target stream.

void write(byte[] bytes, int offset, int byteCount)

Writes to the decompressing output stream.

void write(int b)

Writes a byte to the decompressing output stream.

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

Fields

buf

Added in API level 9
byte[] buf

inf

Added in API level 9
Inflater inf

Public constructors

InflaterOutputStream

Added in API level 9
InflaterOutputStream (OutputStream out)

Constructs an InflaterOutputStream with a new Inflater and an implementation-defined default internal buffer size. out is a destination for uncompressed data, and compressed data will be written to this stream.

Parameters
out OutputStream: the destination OutputStream

InflaterOutputStream

Added in API level 9
InflaterOutputStream (OutputStream out, 
                Inflater inf)

Constructs an InflaterOutputStream with the given Inflater and an implementation-defined default internal buffer size. out is a destination for uncompressed data, and compressed data will be written to this stream.

Parameters
out OutputStream: the destination OutputStream
inf Inflater: the Inflater to be used for decompression

InflaterOutputStream

Added in API level 9
InflaterOutputStream (OutputStream out, 
                Inflater inf, 
                int bufferSize)

Constructs an InflaterOutputStream with the given Inflater and given internal buffer size. out is a destination for uncompressed data, and compressed data will be written to this stream.

Parameters
out OutputStream: the destination OutputStream
inf Inflater: the Inflater to be used for decompression
bufferSize int: the length in bytes of the internal buffer

Public methods

close

Added in API level 9
void close ()

Writes remaining data into the output stream and closes the underlying output stream.

Throws
IOException

finish

Added in API level 9
void finish ()

Finishes writing current uncompressed data into the InflaterOutputStream without closing it.

Throws
IOException if an I/O error occurs, or the stream has been closed

flush

Added in API level 9
void flush ()

Ensures that all pending data is sent out to the target stream. This implementation flushes the target stream.

Throws
IOException

write

Added in API level 9
void write (byte[] bytes, 
                int offset, 
                int byteCount)

Writes to the decompressing output stream. The bytes array should contain compressed input. The corresponding uncompressed data will be written to the underlying stream.

Parameters
bytes byte: the buffer to write.
offset int: the index of the first byte in buffer to write.
byteCount int: the number of bytes in buffer to write.
Throws
IOException if an I/O error occurs, or the stream has been closed
ZipException if a zip exception occurs.
NullPointerException if b == null.
IndexOutOfBoundsException if off < 0 || len < 0 || off + len > b.length

write

Added in API level 9
void write (int b)

Writes a byte to the decompressing output stream. b should be a byte of compressed input. The corresponding uncompressed data will be written to the underlying stream.

Parameters
b int: the byte
Throws
IOException if an I/O error occurs, or the stream has been closed
ZipException if a zip exception occurs.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.