com.myJava.file.archive.zip64
Class InflaterInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.myJava.file.archive.zip64.InflaterInputStream
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
ZipInputStream

public class InflaterInputStream
extends 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.

Version:
1.32, 01/23/03
Author:
David Connelly
This class was derived from the original java.util.zip.InflaterInputStream.
Modifications :
Package change.
in / out fields

CAUTION :
This file has been integrated into Areca.
It is has also possibly been adapted to meet Areca's needs. If such modifications has been made, they are described above.
Thanks to the authors for their work.
Areca Build ID : 7299034069467778562
See Also:
Inflater

Field Summary
protected  byte[] buf
          Input buffer for decompression.
protected  java.util.zip.Inflater inf
          Decompressor for this stream.
protected  int len
          Length of input buffer.
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
InflaterInputStream(java.io.InputStream in)
          Creates a new input stream with a default decompressor and buffer size.
InflaterInputStream(java.io.InputStream in, java.util.zip.Inflater inf)
          Creates a new input stream with the specified decompressor and a default buffer size.
InflaterInputStream(java.io.InputStream in, java.util.zip.Inflater inf, int size)
          Creates a new input stream with the specified decompressor and buffer size.
 
Method Summary
 int available()
          Returns 0 after EOF has reached, otherwise always return 1.
 void close()
          Closes the input stream.
protected  void fill()
          Fills input buffer with more data to decompress.
 long getTotalOut()
           
 int read()
          Reads a byte of uncompressed data.
 int read(byte[] b, int off, int len)
          Reads uncompressed data into an array of bytes.
 void resetInflater()
           
 long skip(long n)
          Skips specified number of bytes of uncompressed data.
 
Methods inherited from class java.io.FilterInputStream
mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inf

protected java.util.zip.Inflater inf
Decompressor for this stream.


buf

protected byte[] buf
Input buffer for decompression.


len

protected int len
Length of input buffer.

Constructor Detail

InflaterInputStream

public InflaterInputStream(java.io.InputStream in,
                           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:
java.lang.IllegalArgumentException - if size is <= 0

InflaterInputStream

public InflaterInputStream(java.io.InputStream in,
                           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

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

Parameters:
in - the input stream
Method Detail

read

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

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

read

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

Overrides:
read in class 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:
java.util.zip.ZipException - if a ZIP format error has occurred
java.io.IOException - if an I/O error has occurred

available

public int available()
              throws java.io.IOException
Returns 0 after EOF has 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 in class java.io.FilterInputStream
Returns:
1 before EOF and 0 after EOF.
Throws:
java.io.IOException - if an I/O error occurs.

skip

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

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

getTotalOut

public long getTotalOut()

resetInflater

public void resetInflater()

close

public void close()
           throws java.io.IOException
Closes the input stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FilterInputStream
Throws:
java.io.IOException - if an I/O error has occurred

fill

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

Throws:
java.io.IOException - if an I/O error has occurred