Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.util.zip

Class InflaterInputStream

java.lang.Object
|
+--java.io.InputStream
   |
   +--java.io.FilterInputStream
      |
      +--java.util.zip.InflaterInputStream


public class InflaterInputStream

extends FilterInputStream

This filter stream is used to decompress data compressed in the "deflate" format. The "deflate" format is described in RFC 1951. This stream may form the basis for other decompression filters, such as the GZIPInputStream.

Since:Author:

Field Summary

byte[]buf

Byte array used as a buffer
java.util.zip.Inflaterinf

Decompressor for this filter
intlen

Size of buffer

Constructor Summary

InflaterInputStream(java.io.InputStream in)

Create an InflaterInputStream with the default decompresseor and a default buffer size.
InflaterInputStream(java.io.InputStream in, java.util.zip.Inflater inf)

Create an InflaterInputStream with the specified decompresseor and a default buffer size.
InflaterInputStream(java.io.InputStream in, java.util.zip.Inflater inf, int size)

Create an InflaterInputStream with the specified decompresseor and a specified buffer size.

Method Summary

intavailable()

Returns 0 once the end of the stream (EOF) has been reached.
voidclose()

Closes the input stream
voidfill()

Fills the buffer with more data to decompress.
voidmark(int readlimit)

Throws an exception.
booleanmarkSupported()

Since this stream tends to buffer large (unpredictable?) amounts of stuff, it causes problems to the mark/reset mechanism.
intread()

Reads one byte of decompressed data.
intread(byte[] b, int off, int len)

Decompresses data into the byte array
voidreset()

Throws an exception.
longskip(long n)

Skip specified number of bytes of uncompressed data

Field Details

buf

protected byte[] buf

Byte array used as a buffer


inf

protected Inflater inf

Decompressor for this filter


len

protected int len

Size of buffer


Constructor Details

InflaterInputStream

public InflaterInputStream(java.io.InputStream in)

Create an InflaterInputStream with the default decompresseor and a default buffer size.

Parameters:


InflaterInputStream

public InflaterInputStream(java.io.InputStream in, java.util.zip.Inflater inf)

Create an InflaterInputStream with the specified decompresseor and a default buffer size.

Parameters:


InflaterInputStream

public InflaterInputStream(java.io.InputStream in, java.util.zip.Inflater inf, int size)

Create an InflaterInputStream with the specified decompresseor and a specified buffer size.

Parameters:


Method Details

available

public int available()

Returns 0 once the end of the stream (EOF) has been reached. Otherwise returns 1.


close

public void close()

Closes the input stream


fill

protected void fill()

Fills the buffer with more data to decompress.


mark

public void mark(int readlimit)

Throws an exception.

Parameters:

See Also:


markSupported

public boolean markSupported()

Since this stream tends to buffer large (unpredictable?) amounts of stuff, it causes problems to the mark/reset mechanism. Hence, it claims not to support mark.

Returns:


read

public int read()

Reads one byte of decompressed data. The byte is in the lower 8 bits of the int.


read

public int read(byte[] b, int off, int len)

Decompresses data into the byte array

Parameters:


reset

public void reset()

Throws an exception.

Throws:

See Also:


skip

public long skip(long n)

Skip specified number of bytes of uncompressed data

Parameters: