java.util.zip
Class InflaterInputStream

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

public class InflaterInputStream
extends FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream

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:
Inflater sample code for java.util.zip.Inflater definition code for java.util.zip.Inflater

Field Summary
protected  byte[] buf sample code for java.util.zip.InflaterInputStream.buf definition code for java.util.zip.InflaterInputStream.buf
          Input buffer for decompression.
protected  Inflater sample code for java.util.zip.Inflater definition code for java.util.zip.Inflater inf sample code for java.util.zip.InflaterInputStream.inf definition code for java.util.zip.InflaterInputStream.inf
          Decompressor for this stream.
protected  int len sample code for java.util.zip.InflaterInputStream.len definition code for java.util.zip.InflaterInputStream.len
          Length of input buffer.
 
Fields inherited from class java.io.FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
in sample code for java.io.FilterInputStream.in definition code for java.io.FilterInputStream.in
 
Constructor Summary
InflaterInputStream sample code for java.util.zip.InflaterInputStream.InflaterInputStream(java.io.InputStream) definition code for java.util.zip.InflaterInputStream.InflaterInputStream(java.io.InputStream) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  in)
          Creates a new input stream with a default decompressor and buffer size.
InflaterInputStream sample code for java.util.zip.InflaterInputStream.InflaterInputStream(java.io.InputStream, java.util.zip.Inflater) definition code for java.util.zip.InflaterInputStream.InflaterInputStream(java.io.InputStream, java.util.zip.Inflater) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  in, Inflater sample code for java.util.zip.Inflater definition code for java.util.zip.Inflater  inf)
          Creates a new input stream with the specified decompressor and a default buffer size.
InflaterInputStream sample code for java.util.zip.InflaterInputStream.InflaterInputStream(java.io.InputStream, java.util.zip.Inflater, int) definition code for java.util.zip.InflaterInputStream.InflaterInputStream(java.io.InputStream, java.util.zip.Inflater, int) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  in, Inflater sample code for java.util.zip.Inflater definition code for java.util.zip.Inflater  inf, int size)
          Creates a new input stream with the specified decompressor and buffer size.
 
Method Summary
 int available sample code for java.util.zip.InflaterInputStream.available() definition code for java.util.zip.InflaterInputStream.available() ()
          Returns 0 after EOF has been reached, otherwise always return 1.
 void close sample code for java.util.zip.InflaterInputStream.close() definition code for java.util.zip.InflaterInputStream.close() ()
          Closes this input stream and releases any system resources associated with the stream.
protected  void fill sample code for java.util.zip.InflaterInputStream.fill() definition code for java.util.zip.InflaterInputStream.fill() ()
          Fills input buffer with more data to decompress.
 void mark sample code for java.util.zip.InflaterInputStream.mark(int) definition code for java.util.zip.InflaterInputStream.mark(int) (int readlimit)
          Marks the current position in this input stream.
 boolean markSupported sample code for java.util.zip.InflaterInputStream.markSupported() definition code for java.util.zip.InflaterInputStream.markSupported() ()
          Tests if this input stream supports the mark and reset methods.
 int read sample code for java.util.zip.InflaterInputStream.read() definition code for java.util.zip.InflaterInputStream.read() ()
          Reads a byte of uncompressed data.
 int read sample code for java.util.zip.InflaterInputStream.read(byte[], int, int) definition code for java.util.zip.InflaterInputStream.read(byte[], int, int) (byte[] b, int off, int len)
          Reads uncompressed data into an array of bytes.
 void reset sample code for java.util.zip.InflaterInputStream.reset() definition code for java.util.zip.InflaterInputStream.reset() ()
          Repositions this stream to the position at the time the mark method was last called on this input stream.
 long skip sample code for java.util.zip.InflaterInputStream.skip(long) definition code for java.util.zip.InflaterInputStream.skip(long) (long n)
          Skips specified number of bytes of uncompressed data.
 
Methods inherited from class java.io.FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
read sample code for java.io.FilterInputStream.read(byte[]) definition code for java.io.FilterInputStream.read(byte[])
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

inf sample code for java.util.zip.InflaterInputStream.inf

protected Inflater sample code for java.util.zip.Inflater definition code for java.util.zip.Inflater  inf
Decompressor for this stream.


buf sample code for java.util.zip.InflaterInputStream.buf

protected byte[] buf
Input buffer for decompression.


len sample code for java.util.zip.InflaterInputStream.len

protected int len
Length of input buffer.

Constructor Detail

InflaterInputStream sample code for java.util.zip.InflaterInputStream(java.io.InputStream, java.util.zip.Inflater, int) definition code for java.util.zip.InflaterInputStream(java.io.InputStream, java.util.zip.Inflater, int)

public InflaterInputStream(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  in,
                           Inflater sample code for java.util.zip.Inflater definition code for java.util.zip.Inflater  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 sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if size is <= 0

InflaterInputStream sample code for java.util.zip.InflaterInputStream(java.io.InputStream, java.util.zip.Inflater) definition code for java.util.zip.InflaterInputStream(java.io.InputStream, java.util.zip.Inflater)

public InflaterInputStream(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  in,
                           Inflater sample code for java.util.zip.Inflater definition code for java.util.zip.Inflater  inf)
Creates a new input stream with the specified decompressor and a default buffer size.

Parameters:
in - the input stream
inf - the decompressor ("inflater")

InflaterInputStream sample code for java.util.zip.InflaterInputStream(java.io.InputStream) definition code for java.util.zip.InflaterInputStream(java.io.InputStream)

public InflaterInputStream(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  in)
Creates a new input stream with a default decompressor and buffer size.

Parameters:
in - the input stream
Method Detail

read sample code for java.util.zip.InflaterInputStream.read() definition code for java.util.zip.InflaterInputStream.read()

public int read()
         throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Reads a byte of uncompressed data. This method will block until enough input is available for decompression.

Overrides:
read sample code for java.io.FilterInputStream.read() definition code for java.io.FilterInputStream.read() in class FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
Returns:
the byte read, or -1 if end of compressed input is reached
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error has occurred
See Also:
FilterInputStream.in sample code for java.io.FilterInputStream.in definition code for java.io.FilterInputStream.in

read sample code for java.util.zip.InflaterInputStream.read(byte[], int, int) definition code for java.util.zip.InflaterInputStream.read(byte[], int, int)

public int read(byte[] b,
                int off,
                int len)
         throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Reads uncompressed data into an array of bytes. This method will block until some input can be decompressed.

Overrides:
read sample code for java.io.FilterInputStream.read(byte[], int, int) definition code for java.io.FilterInputStream.read(byte[], int, int) in class FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
Parameters:
b - the buffer into which the data is read
off - the start offset of the data
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:
ZipException sample code for java.util.zip.ZipException definition code for java.util.zip.ZipException - if a ZIP format error has occurred
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error has occurred
See Also:
FilterInputStream.in sample code for java.io.FilterInputStream.in definition code for java.io.FilterInputStream.in

available sample code for java.util.zip.InflaterInputStream.available() definition code for java.util.zip.InflaterInputStream.available()

public int available()
              throws IOException sample code for java.io.IOException definition code for java.io.IOException 
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.

Overrides:
available sample code for java.io.FilterInputStream.available() definition code for java.io.FilterInputStream.available() in class FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
Returns:
1 before EOF and 0 after EOF.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs.
See Also:
FilterInputStream.in sample code for java.io.FilterInputStream.in definition code for java.io.FilterInputStream.in

skip sample code for java.util.zip.InflaterInputStream.skip(long) definition code for java.util.zip.InflaterInputStream.skip(long)

public long skip(long n)
          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Skips specified number of bytes of uncompressed data.

Overrides:
skip sample code for java.io.FilterInputStream.skip(long) definition code for java.io.FilterInputStream.skip(long) in class FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
Parameters:
n - the number of bytes to skip
Returns:
the actual number of bytes skipped.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error has occurred
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if n < 0

close sample code for java.util.zip.InflaterInputStream.close() definition code for java.util.zip.InflaterInputStream.close()

public void close()
           throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Closes this input stream and releases any system resources associated with the stream.

Specified by:
close sample code for java.io.Closeable.close() definition code for java.io.Closeable.close() in interface Closeable sample code for java.io.Closeable definition code for java.io.Closeable
Overrides:
close sample code for java.io.FilterInputStream.close() definition code for java.io.FilterInputStream.close() in class FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error has occurred
See Also:
FilterInputStream.in sample code for java.io.FilterInputStream.in definition code for java.io.FilterInputStream.in

fill sample code for java.util.zip.InflaterInputStream.fill() definition code for java.util.zip.InflaterInputStream.fill()

protected void fill()
             throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Fills input buffer with more data to decompress.

Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error has occurred

markSupported sample code for java.util.zip.InflaterInputStream.markSupported() definition code for java.util.zip.InflaterInputStream.markSupported()

public boolean markSupported()
Tests if this input stream supports the mark and reset methods. The markSupported method of InflaterInputStream returns false.

Overrides:
markSupported sample code for java.io.FilterInputStream.markSupported() definition code for java.io.FilterInputStream.markSupported() in class FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
Returns:
a boolean indicating if this stream type supports the mark and reset methods.
See Also:
InputStream.mark(int) sample code for java.io.InputStream.mark(int) definition code for java.io.InputStream.mark(int) , InputStream.reset() sample code for java.io.InputStream.reset() definition code for java.io.InputStream.reset()

mark sample code for java.util.zip.InflaterInputStream.mark(int) definition code for java.util.zip.InflaterInputStream.mark(int)

public void mark(int readlimit)
Marks the current position in this input stream.

The mark method of InflaterInputStream does nothing.

Overrides:
mark sample code for java.io.FilterInputStream.mark(int) definition code for java.io.FilterInputStream.mark(int) in class FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
Parameters:
readlimit - the maximum limit of bytes that can be read before the mark position becomes invalid.
See Also:
InputStream.reset() sample code for java.io.InputStream.reset() definition code for java.io.InputStream.reset()

reset sample code for java.util.zip.InflaterInputStream.reset() definition code for java.util.zip.InflaterInputStream.reset()

public void reset()
           throws IOException sample code for java.io.IOException definition code for java.io.IOException 
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.

Overrides:
reset sample code for java.io.FilterInputStream.reset() definition code for java.io.FilterInputStream.reset() in class FilterInputStream sample code for java.io.FilterInputStream definition code for java.io.FilterInputStream
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if this method is invoked.
See Also:
InputStream.mark(int) sample code for java.io.InputStream.mark(int) definition code for java.io.InputStream.mark(int) , IOException sample code for java.io.IOException definition code for java.io.IOException