Top Fields Constructors Methods
com.ning.compress.lzf.impl

public Class VanillaChunkEncoder

extends ChunkEncoder
Class Inheritance
Imports
com.ning.compress.BufferRecycler, com.ning.compress.lzf.ChunkEncoder, .LZFChunk

Field Summary

Inherited from com.ning.compress.lzf.ChunkEncoder:
_encodeBuffer_hashModulo_hashTable_headerBuffer_recyclerMAX_HASH_SIZEMAX_OFFMAX_REFMIN_BLOCK_TO_COMPRESSMIN_HASH_SIZETAIL_LENGTH

Constructor Summary

AccessConstructor and Description
public
VanillaChunkEncoder(int
Total encoded length; used for calculating size of hash table to use
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.

public
VanillaChunkEncoder(int
Total encoded length; used for calculating size of hash table to use
totalLength
,
BufferRecycler
The BufferRecycler instance
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.

Method Summary

Modifier and TypeMethod and Description
private final int
_handleTail(byte[] in, int inPos, int inEnd, byte[] out, int outPos, int literals)

private final int
first(byte[] in, int inPos)

public static VanillaChunkEncoder
nonAllocatingEncoder(int totalLength)

public static VanillaChunkEncoder
nonAllocatingEncoder(int totalLength, BufferRecycler bufferRecycler)

protected int

Returns:

Output pointer after handling content, such that result - originalOutPost is the actual length of compressed chunk (without header)
tryCompress
(byte[] in, int inPos, int inEnd, byte[] out, int outPos)

Implements abstract com.ning.compress.lzf.ChunkEncoder.tryCompress.

Main workhorse method that will try to compress given chunk, and return end position (offset to byte after last included byte)
Inherited from com.ning.compress.lzf.ChunkEncoder:
appendEncodedChunkappendEncodedIfCompressescloseencodeAndWriteChunkencodeAndWriteChunkIfCompressesencodeChunkencodeChunkIfCompressesgetBufferRecyclerhash

Constructor Detail

VanillaChunkEncoderback to summary
public VanillaChunkEncoder(int totalLength)
Parameters
totalLength:int

Total encoded length; used for calculating size of hash table to use

VanillaChunkEncoderback to summary
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.

VanillaChunkEncoderback to summary
public VanillaChunkEncoder(int totalLength, BufferRecycler bufferRecycler)
Parameters
totalLength:int

Total encoded length; used for calculating size of hash table to use

bufferRecycler:BufferRecycler

The BufferRecycler instance

VanillaChunkEncoderback to summary
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.

Method Detail

_handleTailback to summary
private final int _handleTail(byte[] in, int inPos, int inEnd, byte[] out, int outPos, int literals)
firstback to summary
private final int first(byte[] in, int inPos)
nonAllocatingEncoderback to summary
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength)
nonAllocatingEncoderback to summary
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength, BufferRecycler bufferRecycler)
tryCompressback to summary
protected int tryCompress(byte[] in, int inPos, int inEnd, byte[] out, int outPos)

Implements abstract com.ning.compress.lzf.ChunkEncoder.tryCompress.

Main workhorse method that will try to compress given chunk, and return end position (offset to byte after last included byte)

Returns:int

Output pointer after handling content, such that result - originalOutPost is the actual length of compressed chunk (without header)

Annotations
@Override