- java.lang.Object
-
- java.io.InputStream
-
- kala.compress.compressors.CompressorInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
AbstractLZ77CompressorInputStream,BrotliCompressorInputStream,BZip2CompressorInputStream,Deflate64CompressorInputStream,DeflateCompressorInputStream,FramedLZ4CompressorInputStream,FramedSnappyCompressorInputStream,GzipCompressorInputStream,LZMACompressorInputStream,LZWInputStream,Pack200CompressorInputStream,XZCompressorInputStream,ZstdCompressorInputStream
public abstract class CompressorInputStream extends java.io.InputStream
-
-
Field Summary
Fields Modifier and Type Field Description private longbytesRead
-
Constructor Summary
Constructors Constructor Description CompressorInputStream()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcount(int read)Increments the counter of already read bytes.protected voidcount(long read)Increments the counter of already read bytes.longgetBytesRead()Gets the current number of bytes read from this stream.longgetUncompressedCount()Gets the amount of raw or compressed bytes read by the stream.protected voidpushedBackBytes(long pushedBack)Decrements the counter of already read bytes.
-
-
-
Method Detail
-
count
protected void count(int read)
Increments the counter of already read bytes. Doesn't increment if the EOF has been hit (read == -1)- Parameters:
read- the number of bytes read- Since:
- 1.1
-
count
protected void count(long read)
Increments the counter of already read bytes. Doesn't increment if the EOF has been hit (read == -1)- Parameters:
read- the number of bytes read
-
getBytesRead
public long getBytesRead()
Gets the current number of bytes read from this stream.- Returns:
- the number of read bytes
- Since:
- 1.1
-
getUncompressedCount
public long getUncompressedCount()
Gets the amount of raw or compressed bytes read by the stream.This implementation invokes
getBytesRead().Provides half of
org.apache.commons.compress.utils.InputStreamStatisticswithout forcing subclasses to implement the other half.- Returns:
- the amount of decompressed bytes returned by the stream
- Since:
- 1.17
-
pushedBackBytes
protected void pushedBackBytes(long pushedBack)
Decrements the counter of already read bytes.- Parameters:
pushedBack- the number of bytes pushed back.- Since:
- 1.7
-
-