Top Fields Constructors Methods
org.apache.commons.compress.compressors

public abstract Class CompressorInputStream

extends InputStream
Class Inheritance
Known Direct Subclasses
org.apache.commons.compress.compressors.brotli.BrotliCompressorInputStream, org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream, org.apache.commons.compress.compressors.deflate.DeflateCompressorInputStream, org.apache.commons.compress.compressors.deflate64.Deflate64CompressorInputStream, org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream, org.apache.commons.compress.compressors.lz4.FramedLZ4CompressorInputStream, org.apache.commons.compress.compressors.lz77support.AbstractLZ77CompressorInputStream, org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream, org.apache.commons.compress.compressors.lzw.LZWInputStream, org.apache.commons.compress.compressors.pack200.Pack200CompressorInputStream, org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorInputStream, org.apache.commons.compress.compressors.xz.XZCompressorInputStream, org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream
Imports
java.io.InputStream

Field Summary

Modifier and TypeField and Description
private long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
count(final int
the number of bytes read
read
)

Increments the counter of already read bytes.

protected void
count(final long
the number of bytes read
read
)

Increments the counter of already read bytes.

public long

Returns:

the number of read bytes
getBytesRead
()

Returns the current number of bytes read from this stream.

public int

Returns:

the number of read bytes
getCount
()

Deprecated this method may yield wrong results for large archives, use #getBytesRead instead
Returns the current number of bytes read from this stream.
public long

Returns:

the amount of decompressed bytes returned by the stream
getUncompressedCount
()

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

protected void
pushedBackBytes(final long
the number of bytes pushed back.
pushedBack
)

Decrements the counter of already read bytes.

Inherited from java.io.InputStream:
availableclosemarkmarkSupportednullInputStreamreadreadreadreadAllBytesreadNBytesreadNBytesresetskipskipNBytestransferTo

Field Detail

bytesReadback to summary
private long bytesRead

Constructor Detail

CompressorInputStreamback to summary
public CompressorInputStream()

Method Detail

countback to summary
protected void count(final int read)

Increments the counter of already read bytes. Doesn't increment if the EOF has been hit (read == -1)

Parameters
read:int

the number of bytes read

Since
1.1
countback to summary
protected void count(final long read)

Increments the counter of already read bytes. Doesn't increment if the EOF has been hit (read == -1)

Parameters
read:long

the number of bytes read

getBytesReadback to summary
public long getBytesRead()

Returns the current number of bytes read from this stream.

Returns:long

the number of read bytes

Since
1.1
getCountback to summary
public int getCount()

Deprecated

this method may yield wrong results for large archives, use #getBytesRead instead

Returns the current number of bytes read from this stream.

Returns:int

the number of read bytes

Annotations
@Deprecated
getUncompressedCountback to summary
public long getUncompressedCount()

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

This implementation invokes getBytesRead.

Provides half of org.apache.commons.compress.utils.InputStreamStatistics without forcing subclasses to implement the other half.

Returns:long

the amount of decompressed bytes returned by the stream

Since
1.17
pushedBackBytesback to summary
protected void pushedBackBytes(final long pushedBack)

Decrements the counter of already read bytes.

Parameters
pushedBack:long

the number of bytes pushed back.

Since
1.7