Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.zip

pack-priv Class InflaterInputStreamWithStatistics

extends InflaterInputStream
implements InputStreamStatistics
Class Inheritance
All Implemented Interfaces
org.apache.commons.compress.utils.InputStreamStatistics
Imports
java.io.IOException, .InputStream, java.util.zip.Inflater, .InflaterInputStream, org.apache.commons.compress.utils.InputStreamStatistics

Helper class to provide statistics
Since
1.17

Field Summary

Modifier and TypeField and Description
private long
private long
Inherited from java.util.zip.InflaterInputStream:
bufinflen

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
pack-priv
InflaterInputStreamWithStatistics(final InputStream in, final Inflater inf, final int size)

Method Summary

Modifier and TypeMethod and Description
protected void
fill()

Overrides java.util.zip.InflaterInputStream.fill.

Fills input buffer with more data to decompress.
public long
getCompressedCount()

Implements org.apache.commons.compress.utils.InputStreamStatistics.getCompressedCount.

Gets the amount of raw or compressed bytes read by the stream.
public long
getUncompressedCount()

Implements org.apache.commons.compress.utils.InputStreamStatistics.getUncompressedCount.

Gets the amount of decompressed bytes returned by the stream.
public int
read()

Overrides java.util.zip.InflaterInputStream.read.

Reads a byte of uncompressed data.
public int
read(final byte[]
the buffer into which the data is read
b
,
final int
the start offset in the destination array b
off
,
final int
the maximum number of bytes read
len
)

Overrides java.util.zip.InflaterInputStream.read.

Reads uncompressed data into an array of bytes, returning the number of inflated bytes.
Inherited from java.util.zip.InflaterInputStream:
availableclosemarkmarkSupportedresetskip

Field Detail

compressedCountback to summary
private long compressedCount
uncompressedCountback to summary
private long uncompressedCount

Constructor Detail

InflaterInputStreamWithStatisticsback to summary
pack-priv InflaterInputStreamWithStatistics(final InputStream in)
InflaterInputStreamWithStatisticsback to summary
pack-priv InflaterInputStreamWithStatistics(final InputStream in, final Inflater inf)
InflaterInputStreamWithStatisticsback to summary
pack-priv InflaterInputStreamWithStatistics(final InputStream in, final Inflater inf, final int size)

Method Detail

fillback to summary
protected void fill() throws IOException

Overrides java.util.zip.InflaterInputStream.fill.

Doc from java.util.zip.InflaterInputStream.fill.

Fills input buffer with more data to decompress.

Annotations
@Override
Exceptions
IOException:
if an I/O error has occurred
getCompressedCountback to summary
public long getCompressedCount()

Implements org.apache.commons.compress.utils.InputStreamStatistics.getCompressedCount.

Doc from org.apache.commons.compress.utils.InputStreamStatistics.getCompressedCount.

Gets the amount of raw or compressed bytes read by the stream.

Returns:long

the amount of raw or compressed bytes read by the stream.

Annotations
@Override
getUncompressedCountback to summary
public long getUncompressedCount()

Implements org.apache.commons.compress.utils.InputStreamStatistics.getUncompressedCount.

Doc from org.apache.commons.compress.utils.InputStreamStatistics.getUncompressedCount.

Gets the amount of decompressed bytes returned by the stream.

Returns:long

the amount of decompressed bytes returned by the stream.

Annotations
@Override
readback to summary
public int read() throws IOException

Overrides java.util.zip.InflaterInputStream.read.

Doc from java.util.zip.InflaterInputStream.read.

Reads a byte of uncompressed data. This method will block until enough input is available for decompression.

Returns:int

the byte read, or -1 if end of compressed input is reached

Annotations
@Override
Exceptions
IOException:
if an I/O error has occurred
readback to summary
public int read(final byte[] b, final int off, final int len) throws IOException

Overrides java.util.zip.InflaterInputStream.read.

Doc from java.util.zip.InflaterInputStream.read.

Reads uncompressed data into an array of bytes, returning the number of inflated bytes. If len is not zero, the method will block until some input can be decompressed; otherwise, no bytes are read and 0 is returned.

If this method returns a nonzero integer n then buf[off] through buf[off+n-1] contain the uncompressed data. The content of elements buf[off+n] through buf[off+len-1] is undefined, contrary to the specification of the InputStream superclass, so an implementation is free to modify these elements during the inflate operation. If this method returns -1 or throws an exception then the content of buf[off] through buf[off+len-1] is undefined.

Parameters
b:byte[]

the buffer into which the data is read

off:int

the start offset in the destination array b

len:int

the maximum number of bytes read

Returns:int

the actual number of bytes inflated, or -1 if the end of the compressed input is reached or a preset dictionary is needed

Annotations
@Override
Exceptions
IOException:
if an I/O error has occurred