Note that instances have no state, so they are fully thread-safe and reusable.
| Modifier and Type | Field and Description |
|---|---|
| protected static final byte | |
| protected static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | _reportArrayOverflow(byte[] targetBuffer, int outPtr, int dataLen)
Helper method called when it is determined that the target buffer can not hold all data to copy or uncompress |
| protected void | |
| public static int | calculateUncompressedSize(byte[] data, int ptr, int length)
Helper method that will calculate total uncompressed size, for sequence of one or more LZF blocks stored in given byte array. |
| public final byte[] | decode(final byte[] inputBuffer)
Method for decompressing a block of input data encoded in LZF block structure (compatible with lzf command line utility), and can consist of any number of blocks. |
| public final byte[] | decode(final byte[] inputBuffer, int inputPtr, int inputLen)
Method for decompressing a block of input data encoded in LZF block structure (compatible with lzf command line utility), and can consist of any number of blocks. |
| public final int | decode(final byte[] inputBuffer, final byte[] targetBuffer)
Method for decompressing a block of input data encoded in LZF block structure (compatible with lzf command line utility), and can consist of any number of blocks. |
| public int | decode(final byte[] sourceBuffer, int inPtr, int inLength, final byte[] targetBuffer)
Method for decompressing a block of input data encoded in LZF block structure (compatible with LZF command line utility), and can consist of any number of blocks. |
| public abstract int | Returns: The number of bytes placed in the outputBuffer.An input stream of LZF compressed bytes is, final byte[] A byte array used as a scratch area. inputBuffer, final byte[] A byte array in which the result is returned outputBuffer)Main decode from a stream. |
| public abstract void | decodeChunk(byte[] in, int inPos, byte[] out, int outPos, int outEnd)
Main decode method for individual chunks. |
| protected static final void | |
| protected static final int | readHeader(final InputStream is, final byte[] inputBuffer)
Helper method to forcibly load header bytes that must be read before chunk can be handled. |
| protected static final void | |
| public abstract int | Returns: If positive number, number of bytes skipped; if -1, end-of-stream was reached; otherwise, amount of content decoded (using formula ofreturnValue = -(decodedAmount + 2))
|
| protected static final int |
| BYTE_NULL | back to summary |
|---|---|
| protected static final byte BYTE_NULL | |
| HEADER_BYTES | back to summary |
|---|---|
| protected static final int HEADER_BYTES | |
| ChunkDecoder | back to summary |
|---|---|
| public ChunkDecoder() | |
| _reportArrayOverflow | back to summary |
|---|---|
| protected void _reportArrayOverflow(byte[] targetBuffer, int outPtr, int dataLen) throws LZFException Helper method called when it is determined that the target buffer can not hold all data to copy or uncompress | |
| _reportCorruptHeader | back to summary |
|---|---|
| protected void _reportCorruptHeader() throws LZFException | |
| calculateUncompressedSize | back to summary |
|---|---|
| public static int calculateUncompressedSize(byte[] data, int ptr, int length) throws LZFException Helper method that will calculate total uncompressed size, for sequence of one or more LZF blocks stored in given byte array. Will do basic sanity checking, so that this method can be called to verify against some types of corruption. | |
| decode | back to summary |
|---|---|
| public final byte[] decode(final byte[] inputBuffer) throws LZFException Method for decompressing a block of input data encoded in LZF block structure (compatible with lzf command line utility), and can consist of any number of blocks. Note that input MUST consists of a sequence of one or more complete chunks; partial chunks can not be handled. | |
| decode | back to summary |
|---|---|
| public final byte[] decode(final byte[] inputBuffer, int inputPtr, int inputLen) throws LZFException Method for decompressing a block of input data encoded in LZF block structure (compatible with lzf command line utility), and can consist of any number of blocks. Note that input MUST consists of a sequence of one or more complete chunks; partial chunks can not be handled. | |
| decode | back to summary |
|---|---|
| public final int decode(final byte[] inputBuffer, final byte[] targetBuffer) throws LZFException Method for decompressing a block of input data encoded in LZF block structure (compatible with lzf command line utility), and can consist of any number of blocks. Note that input MUST consists of a sequence of one or more complete chunks; partial chunks can not be handled. | |
| decode | back to summary |
|---|---|
| public int decode(final byte[] sourceBuffer, int inPtr, int inLength, final byte[] targetBuffer) throws LZFException Method for decompressing a block of input data encoded in LZF block structure (compatible with LZF command line utility), and can consist of any number of blocks. Note that input MUST consists of a sequence of one or more complete chunks; partial chunks can not be handled. | |
| decodeChunk | back to summary |
|---|---|
| public abstract int decodeChunk(final InputStream is, final byte[] inputBuffer, final byte[] outputBuffer) throws IOException Main decode from a stream. Decompressed bytes are placed in the outputBuffer, inputBuffer is a "scratch-area".
| |
| decodeChunk | back to summary |
|---|---|
| public abstract void decodeChunk(byte[] in, int inPos, byte[] out, int outPos, int outEnd) throws LZFException Main decode method for individual chunks. | |
| readFully | back to summary |
|---|---|
| protected static final void readFully(InputStream is, boolean compressed, byte[] outputBuffer, int offset, int len) throws IOException | |
| readHeader | back to summary |
|---|---|
| protected static final int readHeader(final InputStream is, final byte[] inputBuffer) throws IOException Helper method to forcibly load header bytes that must be read before chunk can be handled. | |
| skipFully | back to summary |
|---|---|
| protected static final void skipFully(final InputStream is, int amount) throws IOException | |
| skipOrDecodeChunk | back to summary |
|---|---|
public abstract int skipOrDecodeChunk(final InputStream is, final byte[] inputBuffer, final byte[] outputBuffer, final long maxToSkip) throws IOException
| |
| uint16 | back to summary |
|---|---|
| protected static final int uint16(byte[] data, int ptr) | |