加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090310014243/http://developer.android.com:80/reference/java/util/zip/InflaterInputStream.html
public class

InflaterInputStream

extends FilterInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ java.util.zip.InflaterInputStream
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

InflaterOutputStream read data which has been compressed using the DEFLATE compression method.

Summary

Fields
protected byte[] buf
protected Inflater inf
protected int len
[Expand]
Inherited Fields
From class java.io.FilterInputStream
Public Constructors
InflaterInputStream(InputStream is)
Constructs a new InflaterOutputStream on is
InflaterInputStream(InputStream is, Inflater inf)
Constructs a new InflaterOutputStream on is, using the Inflater provided in inf.
InflaterInputStream(InputStream is, Inflater inf, int bsize)
Constructs a new InflaterOutputStream on is, using the Inflater provided in inf.
Public Methods
int available()
Returns 0 if this stream has been closed, 1 otherwise.
void close()
Closes the stream
void mark(int readlimit)
Marks the current position in the stream.
boolean markSupported()
Returns whether the receiver implements mark semantics.
int read(byte[] buffer, int off, int nbytes)
Reads up to nbytes of decompressed data and stores it in buf starting at off.
int read()
Reads a single byte of decompressed data.
void reset()
Reset the position of the stream to the last mark position.
long skip(long nbytes)
Skips up to nbytes of uncompressed data.
Protected Methods
void fill()
[Expand]
Inherited Methods
From class java.io.FilterInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Fields

protected byte[] buf

protected Inflater inf

protected int len

Public Constructors

public InflaterInputStream (InputStream is)

Constructs a new InflaterOutputStream on is

Parameters
is The InputStream to read data from

public InflaterInputStream (InputStream is, Inflater inf)

Constructs a new InflaterOutputStream on is, using the Inflater provided in inf.

Parameters
is The InputStream to read data from
inf The Inflater to use for decompression

public InflaterInputStream (InputStream is, Inflater inf, int bsize)

Constructs a new InflaterOutputStream on is, using the Inflater provided in inf. The size of the inflation buffer is determined by bsize.

Parameters
is The InputStream to read data from
inf The Inflater to use for decompression
bsize size of the inflation buffer

Public Methods

public int available ()

Returns 0 if this stream has been closed, 1 otherwise.

Returns
  • the number of bytes available before blocking.
Throws
IOException If an error occurs

public void close ()

Closes the stream

Throws
IOException If an error occurs closing the stream

public void mark (int readlimit)

Marks the current position in the stream. This implementation overrides the supertype implementation to do nothing at all.

Parameters
readlimit of no use

public boolean markSupported ()

Returns whether the receiver implements mark semantics. This type does not support mark, so always responds false.

Returns
  • false

public int read (byte[] buffer, int off, int nbytes)

Reads up to nbytes of decompressed data and stores it in buf starting at off.

Parameters
buffer Buffer to store into
off offset in buffer to store at
nbytes number of bytes to store
Returns
  • Number of uncompressed bytes read
Throws
IOException If an error occurs reading

public int read ()

Reads a single byte of decompressed data.

Returns
  • byte read
Throws
IOException If an error occurs reading

public void reset ()

Reset the position of the stream to the last mark position. This implementation overrides the supertype implementation and always throws an IOException when called.

Throws
IOException if the method is called

public long skip (long nbytes)

Skips up to nbytes of uncompressed data.

Parameters
nbytes Number of bytes to skip
Returns
  • Number of uncompressed bytes skipped
Throws
IOException If an error occurs skipping

Protected Methods

protected void fill ()

Throws
IOException