# InflaterOutputStream

public class **InflaterOutputStream** extends [FilterOutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html)  
Implements an output stream filter for uncompressing data stored in the
"deflate" compression format.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/DeflaterInputStream.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/DeflaterOutputStream.html`

### Field Summary

|---|---|---|
| protected final byte\[\] | [buf](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#buf) | Output buffer for writing uncompressed data. |
| protected final [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) | [inf](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#inf) | Decompressor for this stream. |

### Inherited Field Summary

From class [java.io.FilterOutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html)

|---|---|---|
| protected [OutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html) | [out](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html#out) | The underlying output stream to be filtered. |

### Public Constructor Summary

|---|---|
|   | [InflaterOutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#InflaterOutputStream(java.io.OutputStream))([OutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html) out) Creates a new output stream with a default decompressor and buffer size. |
|   | [InflaterOutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#InflaterOutputStream(java.io.OutputStream,%20java.util.zip.Inflater))([OutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html) out, [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) infl) Creates a new output stream with the specified decompressor and a default buffer size. |
|   | [InflaterOutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#InflaterOutputStream(java.io.OutputStream,%20java.util.zip.Inflater,%20int))([OutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html) out, [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) infl, int bufLen) Creates a new output stream with the specified decompressor and buffer size. |

### Public Method Summary

|---|---|
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#close())() Writes any remaining uncompressed data to the output stream and closes the underlying output stream. |
| void | [finish](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#finish())() Finishes writing uncompressed data to the output stream without closing the underlying stream. |
| void | [flush](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#flush())() Flushes this output stream, forcing any pending buffered output bytes to be written. |
| void | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#write(byte[],%20int,%20int))(byte\[\] b, int off, int len) Writes an array of bytes to the uncompressed output stream. |
| void | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterOutputStream.html#write(int))(int b) Writes a byte to the uncompressed output stream. |

### Inherited Method Summary

From class [java.io.FilterOutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html)

|---|---|
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html#close())() Closes this output stream and releases any system resources associated with the stream. |
| void | [flush](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html#flush())() Flushes this output stream and forces any buffered output bytes to be written out to the stream. |
| void | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html#write(byte[]))(byte\[\] b) Writes `b.length` bytes to this output stream. |
| void | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html#write(byte[],%20int,%20int))(byte\[\] b, int off, int len) Writes `len` bytes from the specified `byte` array starting at offset `off` to this output stream. |
| void | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterOutputStream.html#write(int))(int b) Writes the specified `byte` to this output stream. |

From class [java.io.OutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html)

|---|---|
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html#close())() Closes this output stream and releases any system resources associated with this stream. |
| void | [flush](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html#flush())() Flushes this output stream and forces any buffered output bytes to be written out. |
| void | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html#write(byte[]))(byte\[\] b) Writes `b.length` bytes from the specified byte array to this output stream. |
| void | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html#write(byte[],%20int,%20int))(byte\[\] b, int off, int len) Writes `len` bytes from the specified byte array starting at offset `off` to this output stream. |
| abstract void | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html#write(int))(int b) Writes the specified byte to this output stream. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.io.Closeable](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Closeable.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Closeable.html#close())() Closes this stream and releases any system resources associated with it. |

From interface [java.io.Flushable](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Flushable.html)

|---|---|
| abstract void | [flush](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Flushable.html#flush())() Flushes this stream by writing any buffered output to the underlying stream. |

From interface [java.lang.AutoCloseable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AutoCloseable.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AutoCloseable.html#close())() Closes this resource, relinquishing any underlying resources. |

## Fields

#### protected final byte\[\]
**buf**

Output buffer for writing uncompressed data.

#### protected final [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html)
**inf**

Decompressor for this stream.

## Public Constructors

#### public
**InflaterOutputStream**
([OutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html) out)

Creates a new output stream with a default decompressor and buffer
size.

##### Parameters

| out | output stream to write the uncompressed data to |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `out` is null |
|---|---|

#### public
**InflaterOutputStream**
([OutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html) out, [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) infl)

Creates a new output stream with the specified decompressor and a
default buffer size.

##### Parameters

| out | output stream to write the uncompressed data to |
| infl | decompressor ("inflater") for this stream |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `out` or `infl` is null |
|---|---|

#### public
**InflaterOutputStream**
([OutputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/OutputStream.html) out, [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) infl, int bufLen)

Creates a new output stream with the specified decompressor and
buffer size.

##### Parameters

| out | output stream to write the uncompressed data to |
| infl | decompressor ("inflater") for this stream |
| bufLen | decompression buffer size |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if `bufLen <= 0` |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `out` or `infl` is null |
|---|---|

## Public Methods

#### public void
**close**
()

Writes any remaining uncompressed data to the output stream and closes
the underlying output stream.

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs |
|---|---|

#### public void
**finish**
()

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.

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs or this stream is already closed |
|---|---|

#### public void
**flush**
()

Flushes this output stream, forcing any pending buffered output bytes to be
written.

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs or this stream is already closed |
|---|---|

#### public void
**write**
(byte\[\] b, int off, int len)

Writes an array of bytes to the uncompressed output stream.

##### Parameters

| b | buffer containing compressed data to decompress and write to the output stream |
| off | starting offset of the compressed data within `b` |
| len | number of bytes to decompress from `b` |
|---|---|

##### Throws

| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) | if `off < 0`, or if `len < 0`, or if `len > b.length - off` |
| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs or this stream is already closed |
| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `b` is null |
| [ZipException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipException.html) | if a compression (ZIP) format error occurs |
|---|---|

#### public void
**write**
(int b)

Writes a byte to the uncompressed output stream.

##### Parameters

| b | a single byte of compressed data to decompress and write to the output stream |
|---|---|

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs or this stream is already closed |
| [ZipException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipException.html) | if a compression (ZIP) format error occurs |
|---|---|