Build 1.0_r1(from source)

java.util.zip
Class InflaterInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.util.zip.InflaterInputStream
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
GZIPInputStream, ZipInputStream

public class InflaterInputStream
extends FilterInputStream

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

See Also:
Inflater, DeflaterOutputStream

Field Summary
protected  byte[] buf
           
(package private) static int BUF_SIZE
           
(package private)  boolean closed
           
(package private)  boolean eof
           
protected  Inflater inf
           
protected  int len
           
(package private)  int nativeEndBufSize
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
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.
 
Method Summary
 int available()
          Returns 0 if this stream has been closed, 1 otherwise.
 void close()
          Closes the stream
protected  void fill()
           
 void mark(int readlimit)
          Marks the current position in the stream.
 boolean markSupported()
          Returns whether the receiver implements mark semantics.
 int read()
          Reads a single byte of decompressed data.
 int read(byte[] buffer, int off, int nbytes)
          Reads up to nbytes of decompressed data and stores it in buf starting at off.
 void reset()
          Reset the position of the stream to the last mark position.
 long skip(long nbytes)
          Skips up to nbytes of uncompressed data.
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inf

protected Inflater inf

buf

protected byte[] buf

len

protected int len

closed

boolean closed

eof

boolean eof

BUF_SIZE

static final int BUF_SIZE
See Also:
Constant Field Values

nativeEndBufSize

int nativeEndBufSize
Constructor Detail

InflaterInputStream

public InflaterInputStream(InputStream is)
Constructs a new InflaterOutputStream on is

Parameters:
is - The InputStream to read data from

InflaterInputStream

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

InflaterInputStream

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
Method Detail

read

public int read()
         throws IOException
Reads a single byte of decompressed data.

Overrides:
read in class FilterInputStream
Returns:
byte read
Throws:
IOException - If an error occurs reading

read

public int read(byte[] buffer,
                int off,
                int nbytes)
         throws IOException
Reads up to nbytes of decompressed data and stores it in buf starting at off.

Overrides:
read in class FilterInputStream
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

fill

protected void fill()
             throws IOException
Throws:
IOException

skip

public long skip(long nbytes)
          throws IOException
Skips up to nbytes of uncompressed data.

Overrides:
skip in class FilterInputStream
Parameters:
nbytes - Number of bytes to skip
Returns:
Number of uncompressed bytes skipped
Throws:
IOException - If an error occurs skipping

available

public int available()
              throws IOException
Returns 0 if this stream has been closed, 1 otherwise.

Overrides:
available in class FilterInputStream
Returns:
the number of bytes available before blocking.
Throws:
IOException - If an error occurs

close

public void close()
           throws IOException
Closes the stream

Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream
Throws:
IOException - If an error occurs closing the stream

mark

public void mark(int readlimit)
Marks the current position in the stream. This implementation overrides the supertype implementation to do nothing at all.

Overrides:
mark in class FilterInputStream
Parameters:
readlimit - of no use

reset

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

Overrides:
reset in class FilterInputStream
Throws:
IOException - if the method is called

markSupported

public boolean markSupported()
Returns whether the receiver implements mark semantics. This type does not support mark, so always responds false.

Overrides:
markSupported in class FilterInputStream
Returns:
false

Build 1.0_r1(from source)

Please submit a feedback, bug or feature