# InflaterInputStream

public class **InflaterInputStream** extends [FilterInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html)  

|---|---|---|
| Known Direct Subclasses [GZIPInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/GZIPInputStream.html), [ZipInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html) |---|---| | [GZIPInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/GZIPInputStream.html) | This class implements a stream filter for reading compressed data in the GZIP file format. | | [ZipInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipInputStream.html) | This class implements an input stream filter for reading files in the ZIP file format. | |||

|---|---|---|
| Known Indirect Subclasses [JarInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html) |---|---| | [JarInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/jar/JarInputStream.html) | The `JarInputStream` class is used to read the contents of a JAR file from any input stream. | |||

This class implements a stream filter for uncompressing data in the
"deflate" compression format. It is also used as the basis for other
decompression filters, such as GZIPInputStream.

##### See Also

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

### Field Summary

|---|---|---|
| protected byte\[\] | [buf](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#buf) | Input buffer for decompression. |
| protected boolean | [closed](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#closed) | *This field is deprecated. This field will be removed from a future version of Android and should not be used. Subclasses that access this field need to be modified to keep track of their own closed state by overriding close().* |
| protected [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/InflaterInputStream.html#inf) | Decompressor for this stream. |
| protected int | [len](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#len) | Length of input buffer. |

### Inherited Field Summary

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

|---|---|---|
| protected [InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) | [in](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#in) | The input stream to be filtered. |

### Public Constructor Summary

|---|---|
|   | [InflaterInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#InflaterInputStream(java.io.InputStream,%20java.util.zip.Inflater,%20int))([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in, [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) inf, int size) Creates a new input stream with the specified decompressor and buffer size. |
|   | [InflaterInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#InflaterInputStream(java.io.InputStream,%20java.util.zip.Inflater))([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in, [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) inf) Creates a new input stream with the specified decompressor and a default buffer size. |
|   | [InflaterInputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#InflaterInputStream(java.io.InputStream))([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in) Creates a new input stream with a default decompressor and buffer size. |

### Public Method Summary

|---|---|
| int | [available](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#available())() Returns 0 after EOF has been reached, otherwise always return 1. |
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#close())() Closes this input stream and releases any system resources associated with the stream. |
| synchronized void | [mark](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#mark(int))(int readlimit) Marks the current position in this input stream. |
| boolean | [markSupported](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#markSupported())() Tests if this input stream supports the `mark` and `reset` methods. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#read())() Reads a byte of uncompressed data. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#read(byte[],%20int,%20int))(byte\[\] b, int off, int len) Reads uncompressed data into an array of bytes. |
| synchronized void | [reset](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#reset())() Repositions this stream to the position at the time the `mark` method was last called on this input stream. |
| long | [skip](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#skip(long))(long n) Skips specified number of bytes of uncompressed data. |

### Protected Method Summary

|---|---|
| void | [fill](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#fill())() Fills input buffer with more data to decompress. |

### Inherited Method Summary

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

|---|---|
| int | [available](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#available())() Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#close())() Closes this input stream and releases any system resources associated with the stream. |
| synchronized void | [mark](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#mark(int))(int readlimit) Marks the current position in this input stream. |
| boolean | [markSupported](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#markSupported())() Tests if this input stream supports the `mark` and `reset` methods. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#read())() Reads the next byte of data from this input stream. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#read(byte[],%20int,%20int))(byte\[\] b, int off, int len) Reads up to `len` bytes of data from this input stream into an array of bytes. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#read(byte[]))(byte\[\] b) Reads up to `byte.length` bytes of data from this input stream into an array of bytes. |
| synchronized void | [reset](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#reset())() Repositions this stream to the position at the time the `mark` method was last called on this input stream. |
| long | [skip](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/FilterInputStream.html#skip(long))(long n) Skips over and discards `n` bytes of data from the input stream. |

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

|---|---|
| int | [available](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#available())() Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. |
| void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#close())() Closes this input stream and releases any system resources associated with the stream. |
| synchronized void | [mark](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#mark(int))(int readlimit) Marks the current position in this input stream. |
| boolean | [markSupported](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#markSupported())() Tests if this input stream supports the `mark` and `reset` methods. |
| abstract int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#read())() Reads the next byte of data from the input stream. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#read(byte[],%20int,%20int))(byte\[\] b, int off, int len) Reads up to `len` bytes of data from the input stream into an array of bytes. |
| int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#read(byte[]))(byte\[\] b) Reads some number of bytes from the input stream and stores them into the buffer array `b`. |
| synchronized void | [reset](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#reset())() Repositions this stream to the position at the time the `mark` method was last called on this input stream. |
| long | [skip](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#skip(long))(long n) Skips over and discards `n` bytes of data from this input 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.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 byte\[\]
**buf**

Input buffer for decompression.

#### protected boolean
**closed**


**This field is deprecated.**   
This field will be removed from a future version of Android and should not be
used. Subclasses that access this field need to be modified to keep track of their own
closed state by overriding close().

Indicates whether the `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/InflaterInputStream.html#close()` method has been called, internal use only.

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

Decompressor for this stream.

#### protected int
**len**

Length of input buffer.

## Public Constructors

#### public
**InflaterInputStream**
([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in, [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) inf, int size)

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

##### Parameters

| in | the input stream |
| inf | the decompressor ("inflater") |
| size | the input buffer size |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if `size <= 0` |
|---|---|

#### public
**InflaterInputStream**
([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in, [Inflater](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/Inflater.html) inf)

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

##### Parameters

| in | the input stream |
| inf | the decompressor ("inflater") |
|---|---|

#### public
**InflaterInputStream**
([InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) in)

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

##### Parameters

| in | the input stream |
|---|---|

## Public Methods

#### public int
**available**
()

Returns 0 after EOF has been reached, otherwise always return 1.


Programs should not count on this method to return the actual number
of bytes that could be read without blocking.

##### Returns

- 1 before EOF and 0 after EOF.

##### Throws

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

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

Closes this input stream and releases any system resources associated
with the stream.

##### Throws

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

#### public synchronized void
**mark**
(int readlimit)

Marks the current position in this input stream.

The `mark` method of `InflaterInputStream`
does nothing.

##### Parameters

| readlimit | the maximum limit of bytes that can be read before the mark position becomes invalid. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#reset()`

#### public boolean
**markSupported**
()

Tests if this input stream supports the `mark` and
`reset` methods. The `markSupported`
method of `InflaterInputStream` returns
`false`.

##### Returns

- a `boolean` indicating if this stream type supports the `mark` and `reset` methods.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#mark(int)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#reset()`

#### public int
**read**
()

Reads a byte of uncompressed data. This method will block until
enough input is available for decompression.

##### Returns

- the byte read, or -1 if end of compressed input is reached

##### Throws

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

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

Reads uncompressed data into an array of bytes. If `len` is not
zero, the method will block until some input can be decompressed; otherwise,
no bytes are read and `0` is returned.

##### Parameters

| b | the buffer into which the data is read |
| off | the start offset in the destination array `b` |
| len | the maximum number of bytes read |
|---|---|

##### Returns

- the actual number of bytes read, or -1 if the end of the compressed input is reached or a preset dictionary is needed

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If `b` is `null`. |
| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) | If `off` is negative, `len` is negative, or `len` is greater than `b.length - off` |
| [ZipException](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/zip/ZipException.html) | if a ZIP format error has occurred |
| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error has occurred |
|---|---|

#### public synchronized void
**reset**
()

Repositions this stream to the position at the time the
`mark` method was last called on this input stream.

The method `reset` for class
`InflaterInputStream` does nothing except throw an
`IOException`.

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if this method is invoked. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html#mark(int)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html`

#### public long
**skip**
(long n)

Skips specified number of bytes of uncompressed data.

##### Parameters

| n | the number of bytes to skip |
|---|---|

##### Returns

- the actual number of bytes skipped.

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error has occurred |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if `n < 0` |
|---|---|

## Protected Methods

#### protected void
**fill**
()

Fills input buffer with more data to decompress.

##### Throws

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