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.
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.
|
calculateUncompressedSize, decode, decode, decode, decode, readFully, readHeader, uint16
public final int decodeChunk(InputStream is, byte[] inputBuffer, byte[] outputBuffer) throws IOException
ChunkDecoder
decodeChunk
in class ChunkDecoder
is
- An input stream of LZF compressed bytesinputBuffer
- A byte array used as a scratch area.outputBuffer
- A byte array in which the result is returnedIOException
public final void decodeChunk(byte[] in, int inPos, byte[] out, int outPos, int outEnd) throws IOException
ChunkDecoder
decodeChunk
in class ChunkDecoder
IOException
Copyright © 2013. All Rights Reserved.