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:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
UnsafeChunkEncoderBE
,UnsafeChunkEncoderLE
public abstract class UnsafeChunkEncoder extends ChunkEncoder
ChunkEncoder
implementation that handles actual encoding of individual chunks, using Sun'ssun.misc.Unsafe
functionality, which gives nice extra boost for speed.
-
-
Field Summary
Fields Modifier and Type Field Description protected static long
BYTE_ARRAY_OFFSET
protected static long
BYTE_ARRAY_OFFSET_PLUS2
protected static sun.misc.Unsafe
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
Constructors Constructor Description UnsafeChunkEncoder(int totalLength)
UnsafeChunkEncoder(int totalLength, boolean bogus)
UnsafeChunkEncoder(int totalLength, BufferRecycler bufferRecycler)
UnsafeChunkEncoder(int totalLength, BufferRecycler bufferRecycler, boolean bogus)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static int
_copyFullLiterals(byte[] in, int inPos, byte[] out, int outPos)
protected static int
_copyLongLiterals(byte[] in, int inPos, byte[] out, int outPos, int literals)
protected static int
_copyPartialLiterals(byte[] in, int inPos, byte[] out, int outPos, int literals)
protected static int
_findTailMatchLength(byte[] in, int ptr1, int ptr2, int maxPtr1)
protected static 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
-
-
-
-
Constructor Detail
-
UnsafeChunkEncoder
public UnsafeChunkEncoder(int totalLength)
-
UnsafeChunkEncoder
public UnsafeChunkEncoder(int totalLength, boolean bogus)
-
UnsafeChunkEncoder
public UnsafeChunkEncoder(int totalLength, BufferRecycler bufferRecycler)
-
UnsafeChunkEncoder
public UnsafeChunkEncoder(int totalLength, BufferRecycler bufferRecycler, boolean bogus)
-
-
Method Detail
-
_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)
-
-