Class UnsafeChunkEncoder
java.lang.Object
com.ning.compress.lzf.ChunkEncoder
com.ning.compress.lzf.impl.UnsafeChunkEncoder
- All Implemented Interfaces:
Closeable, AutoCloseable
- Direct Known Subclasses:
UnsafeChunkEncoderBE, UnsafeChunkEncoderLE
ChunkEncoder implementation that handles actual encoding of individual chunks,
using Sun's sun.misc.Unsafe functionality, which gives
nice extra boost for speed.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final longprotected static final longprotected static final sun.misc.UnsafeFields inherited from class ChunkEncoder
_encodeBuffer, _hashModulo, _hashTable, _headerBuffer, _recycler, MAX_HASH_SIZE, MAX_OFF, MAX_REF, MIN_BLOCK_TO_COMPRESS, MIN_HASH_SIZE, TAIL_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionUnsafeChunkEncoder(int totalLength) UnsafeChunkEncoder(int totalLength, boolean bogus) UnsafeChunkEncoder(int totalLength, BufferRecycler bufferRecycler) UnsafeChunkEncoder(int totalLength, BufferRecycler bufferRecycler, boolean bogus) -
Method Summary
Modifier and TypeMethodDescriptionprotected static final int_copyFullLiterals(byte[] in, int inPos, byte[] out, int outPos) protected static final int_copyLongLiterals(byte[] in, int inPos, byte[] out, int outPos, int literals) protected static final int_copyPartialLiterals(byte[] in, int inPos, byte[] out, int outPos, int literals) protected static final int_findTailMatchLength(byte[] in, int ptr1, int ptr2, int maxPtr1) protected static final int_handleTail(byte[] in, int inPos, int inEnd, byte[] out, int outPos, int literals) Methods inherited from class ChunkEncoder
appendEncodedChunk, appendEncodedIfCompresses, close, encodeAndWriteChunk, encodeAndWriteChunkIfCompresses, encodeChunk, encodeChunkIfCompresses, getBufferRecycler, hash, tryCompress
-
Field Details
-
unsafe
protected static final sun.misc.Unsafe unsafe -
BYTE_ARRAY_OFFSET
protected static final long BYTE_ARRAY_OFFSET -
BYTE_ARRAY_OFFSET_PLUS2
protected static final long BYTE_ARRAY_OFFSET_PLUS2
-
-
Constructor Details
-
UnsafeChunkEncoder
public UnsafeChunkEncoder(int totalLength) -
UnsafeChunkEncoder
public UnsafeChunkEncoder(int totalLength, boolean bogus) -
UnsafeChunkEncoder
-
UnsafeChunkEncoder
-
-
Method Details
-
_copyPartialLiterals
protected static final int _copyPartialLiterals(byte[] in, int inPos, byte[] out, int outPos, int literals) -
_copyLongLiterals
protected static final int _copyLongLiterals(byte[] in, int inPos, byte[] out, int outPos, int literals) -
_copyFullLiterals
protected static final int _copyFullLiterals(byte[] in, int inPos, byte[] out, int outPos) -
_handleTail
protected static final int _handleTail(byte[] in, int inPos, int inEnd, byte[] out, int outPos, int literals) -
_findTailMatchLength
protected static final int _findTailMatchLength(byte[] in, int ptr1, int ptr2, int maxPtr1)
-