Based on the "spec" in the version "1.5.1 (31/03/2015)"
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private byte[] | blockDependencyBuffer
Only created if the frame doesn't set the block independence flag. |
| private final XXHash32 | blockHash
Used for block checksum, if present. |
| pack-priv static final int | |
| pack-priv static final int | |
| private final XXHash32 | contentHash
Used for frame header checksum and content checksum, if present. |
| private InputStream | |
| private final boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private final CountingInputStream | |
| private boolean | |
| pack-priv static final byte[] | LZ4_SIGNATURE
Used by FramedLZ4CompressorOutputStream as well. |
| private final byte[] | oneByte
Used in no-arg read method. |
| private static final byte | |
| private static final byte[] | |
| private final ByteUtils. | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| public | FramedLZ4CompressorInputStream(final InputStream
the InputStream from which to read the compressed data in)Creates a new input stream that decompresses streams compressed using the LZ4 frame format and stops after decompressing the first frame. |
| public | FramedLZ4CompressorInputStream(final InputStream
the InputStream from which to read the compressed data in, final boolean if true, decompress until the end of the input; if false, stop after the first LZ4 frame and leave the input position to
point to the next byte after the frame stream decompressConcatenated)Creates a new input stream that decompresses streams compressed using the LZ4 frame format. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | close()
Overrides java. Implements java. |
| public long | getCompressedCount()
Implements org. |
| private void | |
| private static boolean | |
| public static boolean | Returns: true if this is a .sz stream, false otherwisethe bytes to check signature, final int the number of bytes to check length)Checks if the signature matches what is expected for a .lz4 file. |
| private void | |
| private void | |
| public int | read()
Implements abstract java. |
| public int | read(final byte[]
the buffer into which the data is read. b, final int the start offset in array off, final int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. len bytes of data from the input stream into
an array of bytes.
|
| private void | |
| private int | |
| private int | |
| private boolean | |
| private int | skipSkippableFrame(final byte[] b)
Skips over the contents of a skippable frame as well as skippable frames following it. |
| private void | |
| private void |
| BLOCK_CHECKSUM_MASK | back to summary |
|---|---|
| pack-priv static final int BLOCK_CHECKSUM_MASK | |
| BLOCK_INDEPENDENCE_MASK | back to summary |
|---|---|
| pack-priv static final int BLOCK_INDEPENDENCE_MASK | |
| BLOCK_MAX_SIZE_MASK | back to summary |
|---|---|
| pack-priv static final int BLOCK_MAX_SIZE_MASK | |
| blockDependencyBuffer | back to summary |
|---|---|
| private byte[] blockDependencyBuffer Only created if the frame doesn't set the block independence flag. | |
| blockHash | back to summary |
|---|---|
| private final XXHash32 blockHash Used for block checksum, if present. | |
| CONTENT_CHECKSUM_MASK | back to summary |
|---|---|
| pack-priv static final int CONTENT_CHECKSUM_MASK | |
| CONTENT_SIZE_MASK | back to summary |
|---|---|
| pack-priv static final int CONTENT_SIZE_MASK | |
| contentHash | back to summary |
|---|---|
| private final XXHash32 contentHash Used for frame header checksum and content checksum, if present. | |
| currentBlock | back to summary |
|---|---|
| private InputStream currentBlock | |
| decompressConcatenated | back to summary |
|---|---|
| private final boolean decompressConcatenated | |
| endReached | back to summary |
|---|---|
| private boolean endReached | |
| expectBlockChecksum | back to summary |
|---|---|
| private boolean expectBlockChecksum | |
| expectBlockDependency | back to summary |
|---|---|
| private boolean expectBlockDependency | |
| expectContentChecksum | back to summary |
|---|---|
| private boolean expectContentChecksum | |
| expectContentSize | back to summary |
|---|---|
| private boolean expectContentSize | |
| inputStream | back to summary |
|---|---|
| private final CountingInputStream inputStream | |
| inUncompressed | back to summary |
|---|---|
| private boolean inUncompressed | |
| LZ4_SIGNATURE | back to summary |
|---|---|
| pack-priv static final byte[] LZ4_SIGNATURE Used by FramedLZ4CompressorOutputStream as well. | |
| oneByte | back to summary |
|---|---|
| private final byte[] oneByte Used in no-arg read method. | |
| SKIPPABLE_FRAME_PREFIX_BYTE_MASK | back to summary |
|---|---|
| private static final byte SKIPPABLE_FRAME_PREFIX_BYTE_MASK | |
| SKIPPABLE_FRAME_TRAILER | back to summary |
|---|---|
| private static final byte[] SKIPPABLE_FRAME_TRAILER | |
| supplier | back to summary |
|---|---|
| private final ByteUtils. | |
| SUPPORTED_VERSION | back to summary |
|---|---|
| pack-priv static final int SUPPORTED_VERSION | |
| UNCOMPRESSED_FLAG_MASK | back to summary |
|---|---|
| pack-priv static final int UNCOMPRESSED_FLAG_MASK | |
| VERSION_MASK | back to summary |
|---|---|
| pack-priv static final int VERSION_MASK | |
| FramedLZ4CompressorInputStream | back to summary |
|---|---|
| public FramedLZ4CompressorInputStream(final InputStream in) throws IOException Creates a new input stream that decompresses streams compressed using the LZ4 frame format and stops after decompressing the first frame.
| |
| FramedLZ4CompressorInputStream | back to summary |
|---|---|
| public FramedLZ4CompressorInputStream(final InputStream in, final boolean decompressConcatenated) throws IOException Creates a new input stream that decompresses streams compressed using the LZ4 frame format.
| |
| appendToBlockDependencyBuffer | back to summary |
|---|---|
| private void appendToBlockDependencyBuffer(final byte[] b, final int off, int len) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |
| getCompressedCount | back to summary |
|---|---|
| public long getCompressedCount() Implements org. Doc from org. Gets the amount of raw or compressed bytes read by the stream.
| |
| init | back to summary |
|---|---|
| private void init(final boolean firstFrame) throws IOException | |
| isSkippableFrameSignature | back to summary |
|---|---|
| private static boolean isSkippableFrameSignature(final byte[] b) | |
| matches | back to summary |
|---|---|
| public static boolean matches(final byte[] signature, final int length) Checks if the signature matches what is expected for a .lz4 file. .lz4 files start with a four byte signature.
| |
| maybeFinishCurrentBlock | back to summary |
|---|---|
| private void maybeFinishCurrentBlock() throws IOException | |
| nextBlock | back to summary |
|---|---|
| private void nextBlock() throws IOException | |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(final byte[] b, final int off, final int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| readFrameDescriptor | back to summary |
|---|---|
| private void readFrameDescriptor() throws IOException | |
| readOnce | back to summary |
|---|---|
| private int readOnce(final byte[] b, final int off, final int len) throws IOException | |
| readOneByte | back to summary |
|---|---|
| private int readOneByte() throws IOException | |
| readSignature | back to summary |
|---|---|
| private boolean readSignature(final boolean firstFrame) throws IOException | |
| skipSkippableFrame | back to summary |
|---|---|
| private int skipSkippableFrame(final byte[] b) throws IOException Skips over the contents of a skippable frame as well as skippable frames following it. It then tries to read four more bytes which are supposed to hold an LZ4 signature and returns the number of bytes read while storing the bytes in the given array. | |
| verifyChecksum | back to summary |
|---|---|
| private void verifyChecksum(final XXHash32 hash, final String kind) throws IOException | |
| verifyContentChecksum | back to summary |
|---|---|
| private void verifyContentChecksum() throws IOException | |