FastLzFrameEncoder and FastLzFrameDecoder.
This is refactored code of jfastlz
library written by William Kinney.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| pack-priv static final int | LEVEL_1
Level 1 is the fastest compression and generally useful for short data. |
| pack-priv static final int | LEVEL_2
Level 2 is slightly slower but it gives better compression ratio. |
| pack-priv static final int | LEVEL_AUTO
In this case |
| pack-priv static final int | |
| pack-priv static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| pack-priv static final int | MIN_LENGTH_TO_COMPRESSION
Do not call |
| private static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int | Returns: Maximum output buffer lengthlength of input buffer inputLength)The output buffer must be at least 6% larger than the input buffer and can not be smaller than 66 bytes. |
| pack-priv static int | |
| pack-priv static int | decompress(final ByteBuf input, final int inOffset, final int inLength, final ByteBuf output, final int outOffset, final int outLength)
Decompress a block of compressed data and returns the size of the decompressed block. |
| private static int | |
| private static int |
| BLOCK_TYPE_COMPRESSED | back to summary |
|---|---|
| pack-priv static final byte BLOCK_TYPE_COMPRESSED | |
| BLOCK_TYPE_NON_COMPRESSED | back to summary |
|---|---|
| pack-priv static final byte BLOCK_TYPE_NON_COMPRESSED | |
| BLOCK_WITH_CHECKSUM | back to summary |
|---|---|
| pack-priv static final byte BLOCK_WITH_CHECKSUM | |
| BLOCK_WITHOUT_CHECKSUM | back to summary |
|---|---|
| pack-priv static final byte BLOCK_WITHOUT_CHECKSUM | |
| CHECKSUM_OFFSET | back to summary |
|---|---|
| pack-priv static final int CHECKSUM_OFFSET | |
| HASH_LOG | back to summary |
|---|---|
| private static final int HASH_LOG | |
| HASH_MASK | back to summary |
|---|---|
| private static final int HASH_MASK | |
| HASH_SIZE | back to summary |
|---|---|
| private static final int HASH_SIZE | |
| LEVEL_1 | back to summary |
|---|---|
| pack-priv static final int LEVEL_1 Level 1 is the fastest compression and generally useful for short data. | |
| LEVEL_2 | back to summary |
|---|---|
| pack-priv static final int LEVEL_2 Level 2 is slightly slower but it gives better compression ratio. | |
| LEVEL_AUTO | back to summary |
|---|---|
| pack-priv static final int LEVEL_AUTO In this case | |
| MAGIC_NUMBER | back to summary |
|---|---|
| pack-priv static final int MAGIC_NUMBER | |
| MAX_CHUNK_LENGTH | back to summary |
|---|---|
| pack-priv static final int MAX_CHUNK_LENGTH | |
| MAX_COPY | back to summary |
|---|---|
| private static final int MAX_COPY | |
| MAX_DISTANCE | back to summary |
|---|---|
| private static final int MAX_DISTANCE | |
| MAX_FARDISTANCE | back to summary |
|---|---|
| private static final int MAX_FARDISTANCE | |
| MAX_LEN | back to summary |
|---|---|
| private static final int MAX_LEN | |
| MIN_LENGTH_TO_COMPRESSION | back to summary |
|---|---|
| pack-priv static final int MIN_LENGTH_TO_COMPRESSION Do not call | |
| MIN_RECOMENDED_LENGTH_FOR_LEVEL_2 | back to summary |
|---|---|
| private static final int MIN_RECOMENDED_LENGTH_FOR_LEVEL_2 | |
| OPTIONS_OFFSET | back to summary |
|---|---|
| pack-priv static final int OPTIONS_OFFSET | |
| FastLz | back to summary |
|---|---|
| private FastLz() | |
| calculateOutputBufferLength | back to summary |
|---|---|
| pack-priv static int calculateOutputBufferLength(int inputLength) The output buffer must be at least 6% larger than the input buffer and can not be smaller than 66 bytes.
| |
| compress | back to summary |
|---|---|
| pack-priv static int compress(final ByteBuf input, final int inOffset, final int inLength, final ByteBuf output, final int outOffset, final int proposedLevel) Compress a block of data in the input buffer and returns the size of compressed block. The size of input buffer is specified by length. The minimum input buffer size is 32. If the input is not compressible, the return value might be larger than length (input buffer size).
| |
| decompress | back to summary |
|---|---|
| pack-priv static int decompress(final ByteBuf input, final int inOffset, final int inLength, final ByteBuf output, final int outOffset, final int outLength) Decompress a block of compressed data and returns the size of the decompressed block. If error occurs, e.g. the compressed data is corrupted or the output buffer is not large enough, then 0 (zero) will be returned instead. Decompression is memory safe and guaranteed not to write the output buffer more than what is specified in outLength. | |
| hashFunction | back to summary |
|---|---|
| private static int hashFunction(ByteBuf p, int offset) | |
| readU16 | back to summary |
|---|---|
| private static int readU16(ByteBuf data, int offset) | |