public class VanillaChunkEncoder extends ChunkEncoder
_encodeBuffer, _hashModulo, _hashTable, _headerBuffer, _recycler, MAX_HASH_SIZE, MAX_OFF, MAX_REF, MIN_BLOCK_TO_COMPRESS, MIN_HASH_SIZE, TAIL_LENGTH
Modifier | Constructor and Description |
---|---|
|
VanillaChunkEncoder(int totalLength) |
protected |
VanillaChunkEncoder(int totalLength,
boolean bogus)
Alternate constructor used when we want to avoid allocation encoding
buffer, in cases where caller wants full control over allocations.
|
|
VanillaChunkEncoder(int totalLength,
BufferRecycler bufferRecycler) |
protected |
VanillaChunkEncoder(int totalLength,
BufferRecycler bufferRecycler,
boolean bogus)
Alternate constructor used when we want to avoid allocation encoding
buffer, in cases where caller wants full control over allocations.
|
Modifier and Type | Method and Description |
---|---|
static VanillaChunkEncoder |
nonAllocatingEncoder(int totalLength) |
static VanillaChunkEncoder |
nonAllocatingEncoder(int totalLength,
BufferRecycler bufferRecycler) |
protected int |
tryCompress(byte[] in,
int inPos,
int inEnd,
byte[] out,
int outPos)
Main workhorse method that will try to compress given chunk, and return
end position (offset to byte after last included byte)
|
appendEncodedChunk, appendEncodedIfCompresses, close, encodeAndWriteChunk, encodeAndWriteChunkIfCompresses, encodeChunk, encodeChunkIfCompresses, getBufferRecycler, hash
public VanillaChunkEncoder(int totalLength)
totalLength
- Total encoded length; used for calculating size
of hash table to useprotected VanillaChunkEncoder(int totalLength, boolean bogus)
public VanillaChunkEncoder(int totalLength, BufferRecycler bufferRecycler)
totalLength
- Total encoded length; used for calculating size
of hash table to usebufferRecycler
- The BufferRecycler instanceprotected VanillaChunkEncoder(int totalLength, BufferRecycler bufferRecycler, boolean bogus)
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength)
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength, BufferRecycler bufferRecycler)
protected int tryCompress(byte[] in, int inPos, int inEnd, byte[] out, int outPos)
tryCompress
in class ChunkEncoder
result - originalOutPost
is the actual length of compressed chunk (without header)Copyright © 2017. All Rights Reserved.