Package com.ning.compress.lzf.impl
Class UnsafeChunkEncoderBE
- java.lang.Object
-
- com.ning.compress.lzf.ChunkEncoder
-
- com.ning.compress.lzf.impl.UnsafeChunkEncoder
-
- com.ning.compress.lzf.impl.UnsafeChunkEncoderBE
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public final class UnsafeChunkEncoderBE extends UnsafeChunkEncoder
Implementation to use on Big-Endian architectures.
-
-
Field Summary
-
Fields inherited from class com.ning.compress.lzf.impl.UnsafeChunkEncoder
BYTE_ARRAY_OFFSET, BYTE_ARRAY_OFFSET_PLUS2, 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 UnsafeChunkEncoderBE(int totalLength)
UnsafeChunkEncoderBE(int totalLength, boolean bogus)
UnsafeChunkEncoderBE(int totalLength, BufferRecycler bufferRecycler)
UnsafeChunkEncoderBE(int totalLength, BufferRecycler bufferRecycler, boolean bogus)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
_findLongMatchLength(byte[] in, int ptr1, int ptr2, int maxPtr1)
private static int
_findMatchLength(byte[] in, int ptr1, int ptr2, int maxPtr1)
private static int
_getInt(byte[] in, int inPos)
private static int
_leadingBytes(int i1, int i2)
private static int
_leadingBytes(long l1, long l2)
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).-
Methods inherited from class com.ning.compress.lzf.impl.UnsafeChunkEncoder
_copyFullLiterals, _copyLongLiterals, _copyPartialLiterals, _findTailMatchLength, _handleTail
-
Methods inherited from class com.ning.compress.lzf.ChunkEncoder
appendEncodedChunk, appendEncodedIfCompresses, close, encodeAndWriteChunk, encodeAndWriteChunkIfCompresses, encodeChunk, encodeChunkIfCompresses, getBufferRecycler, hash
-
-
-
-
Constructor Detail
-
UnsafeChunkEncoderBE
public UnsafeChunkEncoderBE(int totalLength)
-
UnsafeChunkEncoderBE
public UnsafeChunkEncoderBE(int totalLength, boolean bogus)
-
UnsafeChunkEncoderBE
public UnsafeChunkEncoderBE(int totalLength, BufferRecycler bufferRecycler)
-
UnsafeChunkEncoderBE
public UnsafeChunkEncoderBE(int totalLength, BufferRecycler bufferRecycler, boolean bogus)
-
-
Method Detail
-
tryCompress
protected int tryCompress(byte[] in, int inPos, int inEnd, byte[] out, int outPos)
Description copied from class:ChunkEncoder
Main workhorse method that will try to compress given chunk, and return end position (offset to byte after last included byte). Result will be "raw" encoded contents without chunk header information: caller is responsible for prepending header, if it chooses to use encoded data; it may also choose to instead create an uncompressed chunk.- Specified by:
tryCompress
in classChunkEncoder
- Returns:
- Output pointer after handling content, such that
result - originalOutPost
is the actual length of compressed chunk (without header)
-
_getInt
private static final int _getInt(byte[] in, int inPos)
-
_findMatchLength
private static final int _findMatchLength(byte[] in, int ptr1, int ptr2, int maxPtr1)
-
_findLongMatchLength
private static final int _findLongMatchLength(byte[] in, int ptr1, int ptr2, int maxPtr1)
-
_leadingBytes
private static final int _leadingBytes(int i1, int i2)
-
_leadingBytes
private static final int _leadingBytes(long l1, long l2)
-
-