InflaterOutputStream - JRE Emulation | JRE Emulation
public class

InflaterOutputStream

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

Class Overview

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
[Expand]
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()
Flushes this output stream and forces any buffered output bytes to be written out to the 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
[Expand]
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

protected final byte[] buf

protected final Inflater inf

Public Constructors

public 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 the destination OutputStream

public 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 the destination OutputStream
inf the Inflater to be used for decompression

public 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 the destination OutputStream
inf the Inflater to be used for decompression
bufferSize the length in bytes of the internal buffer

Public Methods

public void close ()

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

Throws
IOException

public 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

public void flush ()

Flushes this output stream and forces any buffered output bytes to be written out to the stream.

The flush method of FilterOutputStream calls the flush method of its underlying output stream.

Throws
IOException

public 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 the data.
offset the start offset in the data.
byteCount the number of bytes 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

public 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 the byte
Throws
IOException if an I/O error occurs, or the stream has been closed
ZipException if a zip exception occurs.