Android
java.util.zip
public class

java.util.zip.InflaterInputStream

java.lang.Object
java.io.InputStream Closeable
java.io.FilterInputStream
java.util.zip.InflaterInputStream

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

Known Direct Subclasses
Known Indirect Subclasses

Summary

Fields

protected      byte[]  buf   
protected      Inflater  inf   
protected      int  len   
Fields inherited 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()
Methods inherited from class java.io.FilterInputStream
Methods inherited from class java.io.InputStream
Methods inherited from class java.lang.Object
Methods inherited from interface java.io.Closeable

Details

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
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56