Package com.ning.compress.lzf.impl
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 long
protected static final long
protected static final sun.misc.Unsafe
Fields inherited from class com.ning.compress.lzf.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 com.ning.compress.lzf.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)
-