public abstract class ChunkDecoder extends Object
Modifier and Type | Field and Description |
---|---|
protected static byte |
BYTE_NULL |
protected static int |
HEADER_BYTES |
Constructor and Description |
---|
ChunkDecoder() |
Modifier and Type | Method and Description |
---|---|
static int |
calculateUncompressedSize(byte[] data,
int ptr,
int length)
Helper method that will calculate total uncompressed size, for sequence of
one or more LZF blocks stored in given byte array.
|
byte[] |
decode(byte[] inputBuffer)
Method for decompressing a block of input data encoded in LZF
block structure (compatible with lzf command line utility),
and can consist of any number of blocks.
|
int |
decode(byte[] inputBuffer,
byte[] targetBuffer)
Method for decompressing a block of input data encoded in LZF
block structure (compatible with lzf command line utility),
and can consist of any number of blocks.
|
byte[] |
decode(byte[] inputBuffer,
int inputPtr,
int inputLen)
Method for decompressing a block of input data encoded in LZF
block structure (compatible with lzf command line utility),
and can consist of any number of blocks.
|
int |
decode(byte[] sourceBuffer,
int inPtr,
int inLength,
byte[] targetBuffer)
Method for decompressing a block of input data encoded in LZF
block structure (compatible with lzf command line utility),
and can consist of any number of blocks.
|
abstract void |
decodeChunk(byte[] in,
int inPos,
byte[] out,
int outPos,
int outEnd)
Main decode method for individual chunks.
|
abstract int |
decodeChunk(InputStream is,
byte[] inputBuffer,
byte[] outputBuffer)
Main decode from a stream.
|
protected static void |
readFully(InputStream is,
boolean compressed,
byte[] outputBuffer,
int offset,
int len) |
protected static int |
readHeader(InputStream is,
byte[] inputBuffer)
Helper method to forcibly load header bytes that must be read before
chunk can be handled.
|
protected static int |
uint16(byte[] data,
int ptr) |
protected static final byte BYTE_NULL
protected static final int HEADER_BYTES
public final byte[] decode(byte[] inputBuffer) throws IOException
IOException
public final byte[] decode(byte[] inputBuffer, int inputPtr, int inputLen) throws IOException
IOException
public final int decode(byte[] inputBuffer, byte[] targetBuffer) throws IOException
IOException
public int decode(byte[] sourceBuffer, int inPtr, int inLength, byte[] targetBuffer) throws IOException
IOException
public abstract int decodeChunk(InputStream is, byte[] inputBuffer, byte[] outputBuffer) throws IOException
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 abstract void decodeChunk(byte[] in, int inPos, byte[] out, int outPos, int outEnd) throws IOException
IOException
public static int calculateUncompressedSize(byte[] data, int ptr, int length) throws IOException
IOException
protected static final int uint16(byte[] data, int ptr)
protected static final int readHeader(InputStream is, byte[] inputBuffer) throws IOException
IOException
protected static final void readFully(InputStream is, boolean compressed, byte[] outputBuffer, int offset, int len) throws IOException
IOException
Copyright © 2013. All Rights Reserved.