public class UnsafeChunkDecoder extends ChunkDecoder
ChunkDecoder implementation that uses
Sun JDK's Unsafe class (which may be included by other JDK's as well;
IBM's apparently does).
Credits for the idea go to Dain Sundstrom, who kindly suggested this use, and is all-around great source for optimization tips and tricks. Big thanks also to LZ4-java developers, whose stellar performance made me go back and see what more I can do to optimize this code!
BYTE_NULL, HEADER_BYTES| Constructor and Description |
|---|
UnsafeChunkDecoder() |
| Modifier and Type | Method and Description |
|---|---|
void |
decodeChunk(byte[] in,
int inPos,
byte[] out,
int outPos,
int outEnd)
Main decode method for individual chunks.
|
int |
decodeChunk(InputStream is,
byte[] inputBuffer,
byte[] outputBuffer)
Main decode from a stream.
|
int |
skipOrDecodeChunk(InputStream is,
byte[] inputBuffer,
byte[] outputBuffer,
long maxToSkip) |
_reportArrayOverflow, _reportCorruptHeader, calculateUncompressedSize, decode, decode, decode, decode, readFully, readHeader, skipFully, uint16public final int decodeChunk(InputStream is, byte[] inputBuffer, byte[] outputBuffer) throws IOException
ChunkDecoderdecodeChunk in class ChunkDecoderis - An input stream of LZF compressed bytesinputBuffer - A byte array used as a scratch area.outputBuffer - A byte array in which the result is returnedIOExceptionpublic final void decodeChunk(byte[] in,
int inPos,
byte[] out,
int outPos,
int outEnd)
throws LZFException
ChunkDecoderdecodeChunk in class ChunkDecoderLZFExceptionpublic int skipOrDecodeChunk(InputStream is, byte[] inputBuffer, byte[] outputBuffer, long maxToSkip) throws IOException
skipOrDecodeChunk in class ChunkDecoderreturnValue = -(decodedAmount + 2))IOExceptionCopyright © 2023 FasterXML. All rights reserved.