Class BlockLZ4CompressorInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.compress.compressors.CompressorInputStream
-
- org.apache.commons.compress.compressors.lz77support.AbstractLZ77CompressorInputStream
-
- org.apache.commons.compress.compressors.lz4.BlockLZ4CompressorInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,InputStreamStatistics
public class BlockLZ4CompressorInputStream extends AbstractLZ77CompressorInputStream
CompressorInputStream for the LZ4 block format.- Since:
- 1.14
- See Also:
- LZ4 Block Format Description
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
BlockLZ4CompressorInputStream.State
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
BACK_REFERENCE_SIZE_MASK
(package private) static int
LITERAL_SIZE_MASK
private int
nextBackReferenceSize
Back-Reference-size part of the block starting byte.(package private) static int
SIZE_BITS
private BlockLZ4CompressorInputStream.State
state
Current state of the stream(package private) static int
WINDOW_SIZE
-
Fields inherited from class org.apache.commons.compress.compressors.lz77support.AbstractLZ77CompressorInputStream
supplier
-
-
Constructor Summary
Constructors Constructor Description BlockLZ4CompressorInputStream(java.io.InputStream is)
Creates a new LZ4 input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
initializeBackReference()
int
read(byte[] b, int off, int len)
private long
readSizeBytes()
private void
readSizes()
-
Methods inherited from class org.apache.commons.compress.compressors.lz77support.AbstractLZ77CompressorInputStream
available, close, getCompressedCount, getSize, hasMoreDataInBlock, prefill, read, readBackReference, readLiteral, readOneByte, startBackReference, startLiteral
-
Methods inherited from class org.apache.commons.compress.compressors.CompressorInputStream
count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytes
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.compress.utils.InputStreamStatistics
getUncompressedCount
-
-
-
-
Field Detail
-
WINDOW_SIZE
static final int WINDOW_SIZE
- See Also:
- Constant Field Values
-
SIZE_BITS
static final int SIZE_BITS
- See Also:
- Constant Field Values
-
BACK_REFERENCE_SIZE_MASK
static final int BACK_REFERENCE_SIZE_MASK
- See Also:
- Constant Field Values
-
LITERAL_SIZE_MASK
static final int LITERAL_SIZE_MASK
- See Also:
- Constant Field Values
-
nextBackReferenceSize
private int nextBackReferenceSize
Back-Reference-size part of the block starting byte.
-
state
private BlockLZ4CompressorInputStream.State state
Current state of the stream
-
-
Method Detail
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
readSizes
private void readSizes() throws java.io.IOException
- Throws:
java.io.IOException
-
readSizeBytes
private long readSizeBytes() throws java.io.IOException
- Throws:
java.io.IOException
-
initializeBackReference
private boolean initializeBackReference() throws java.io.IOException
- Returns:
- false if there is no more back-reference - this means this is the last block of the stream.
- Throws:
java.io.IOException
-
-