public class LZFChunk extends Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
_data |
protected LZFChunk |
_next |
static int |
BLOCK_TYPE_COMPRESSED |
static int |
BLOCK_TYPE_NON_COMPRESSED |
static byte |
BYTE_V |
static byte |
BYTE_Z |
static int |
HEADER_LEN_COMPRESSED |
static int |
HEADER_LEN_NOT_COMPRESSED |
static int |
MAX_CHUNK_LEN
Chunk length is limited by 2-byte length indicator, to 64k
|
static int |
MAX_HEADER_LEN
Header can be either 7 bytes (compressed) or 5 bytes (uncompressed)
long
|
static int |
MAX_LITERAL
Maximum length of literal run for LZF encoding.
|
Modifier and Type | Method and Description |
---|---|
static int |
appendCompressedHeader(int origLen,
int encLen,
byte[] headerBuffer,
int offset) |
static int |
appendNonCompressed(byte[] plainData,
int ptr,
int len,
byte[] outputBuffer,
int outputPtr)
Method for appending specific content as non-compressed chunk, in
given buffer.
|
static int |
appendNonCompressedHeader(int len,
byte[] headerBuffer,
int offset) |
int |
copyTo(byte[] dst,
int ptr) |
static LZFChunk |
createCompressed(int origLen,
byte[] encData,
int encPtr,
int encLen)
Factory method for constructing compressed chunk
|
static LZFChunk |
createNonCompressed(byte[] plainData,
int ptr,
int len)
Factory method for constructing compressed chunk
|
byte[] |
getData() |
int |
length() |
LZFChunk |
next() |
void |
setNext(LZFChunk next) |
static void |
writeCompressedHeader(int origLen,
int encLen,
OutputStream out,
byte[] headerBuffer) |
static void |
writeNonCompressedHeader(int len,
OutputStream out,
byte[] headerBuffer) |
public static final int MAX_LITERAL
public static final int MAX_CHUNK_LEN
public static final int MAX_HEADER_LEN
public static final int HEADER_LEN_COMPRESSED
public static final int HEADER_LEN_NOT_COMPRESSED
public static final byte BYTE_Z
public static final byte BYTE_V
public static final int BLOCK_TYPE_NON_COMPRESSED
public static final int BLOCK_TYPE_COMPRESSED
protected final byte[] _data
protected LZFChunk _next
public static LZFChunk createCompressed(int origLen, byte[] encData, int encPtr, int encLen)
public static int appendCompressedHeader(int origLen, int encLen, byte[] headerBuffer, int offset)
public static void writeCompressedHeader(int origLen, int encLen, OutputStream out, byte[] headerBuffer) throws IOException
IOException
public static LZFChunk createNonCompressed(byte[] plainData, int ptr, int len)
public static int appendNonCompressed(byte[] plainData, int ptr, int len, byte[] outputBuffer, int outputPtr)
public static int appendNonCompressedHeader(int len, byte[] headerBuffer, int offset)
public static void writeNonCompressedHeader(int len, OutputStream out, byte[] headerBuffer) throws IOException
IOException
public void setNext(LZFChunk next)
public LZFChunk next()
public int length()
public byte[] getData()
public int copyTo(byte[] dst, int ptr)
Copyright © 2017. All Rights Reserved.