Package com.ning.compress.lzf.impl
Class VanillaChunkDecoder
java.lang.Object
com.ning.compress.lzf.ChunkDecoder
com.ning.compress.lzf.impl.VanillaChunkDecoder
Safe
ChunkDecoder
implementation that can be used on any
platform.-
Field Summary
Fields inherited from class com.ning.compress.lzf.ChunkDecoder
BYTE_NULL, HEADER_BYTES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static final void
copyUpTo32WithSwitch
(byte[] in, int inPos, byte[] out, int outPos, int lengthMinusOne) final void
decodeChunk
(byte[] in, int inPos, byte[] out, int outPos, int outEnd) Main decode method for individual chunks.final int
decodeChunk
(InputStream is, byte[] inputBuffer, byte[] outputBuffer) Main decode from a stream.int
skipOrDecodeChunk
(InputStream is, byte[] inputBuffer, byte[] outputBuffer, long maxToSkip) Methods inherited from class com.ning.compress.lzf.ChunkDecoder
_reportArrayOverflow, _reportCorruptHeader, calculateUncompressedSize, decode, decode, decode, decode, readFully, readHeader, skipFully, uint16
-
Constructor Details
-
VanillaChunkDecoder
public VanillaChunkDecoder()
-
-
Method Details
-
decodeChunk
public final int decodeChunk(InputStream is, byte[] inputBuffer, byte[] outputBuffer) throws IOException Description copied from class:ChunkDecoder
Main decode from a stream. Decompressed bytes are placed in the outputBuffer, inputBuffer is a "scratch-area".- Specified by:
decodeChunk
in classChunkDecoder
- Parameters:
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 returned- Returns:
- The number of bytes placed in the outputBuffer.
- Throws:
IOException
-
decodeChunk
public final void decodeChunk(byte[] in, int inPos, byte[] out, int outPos, int outEnd) throws LZFException Description copied from class:ChunkDecoder
Main decode method for individual chunks.- Specified by:
decodeChunk
in classChunkDecoder
- Throws:
LZFException
-
skipOrDecodeChunk
public int skipOrDecodeChunk(InputStream is, byte[] inputBuffer, byte[] outputBuffer, long maxToSkip) throws IOException - Specified by:
skipOrDecodeChunk
in classChunkDecoder
- Returns:
- If positive number, number of bytes skipped; if -1, end-of-stream was
reached; otherwise, amount of content
decoded (using formula of
returnValue = -(decodedAmount + 2)
) - Throws:
IOException
-
copyUpTo32WithSwitch
protected static final void copyUpTo32WithSwitch(byte[] in, int inPos, byte[] out, int outPos, int lengthMinusOne)
-