public class LZFEncoder extends Object
ChunkEncoder to compress individual chunks and
combines resulting chunks into contiguous output byte array.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CHUNK_RESULT_SIZE |
| Modifier and Type | Method and Description |
|---|---|
static int |
appendEncoded(byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr)
Alternate version that accepts pre-allocated output buffer.
|
static int |
appendEncoded(byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr,
BufferRecycler bufferRecycler)
Alternate version that accepts pre-allocated output buffer.
|
static int |
appendEncoded(ChunkEncoder enc,
byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr)
Alternate version that accepts pre-allocated output buffer.
|
static byte[] |
encode(byte[] data)
Method for compressing given input data using LZF encoding and
block structure (compatible with lzf command line utility).
|
static byte[] |
encode(byte[] data,
int offset,
int length)
Method for compressing given input data using LZF encoding and
block structure (compatible with lzf command line utility).
|
static byte[] |
encode(byte[] data,
int offset,
int length,
BufferRecycler bufferRecycler)
Method for compressing given input data using LZF encoding and
block structure (compatible with lzf command line utility).
|
static byte[] |
encode(ChunkEncoder enc,
byte[] data,
int length)
Compression method that uses specified
ChunkEncoder for actual
encoding. |
static byte[] |
encode(ChunkEncoder enc,
byte[] data,
int offset,
int length)
Method that encodes given input using provided
ChunkEncoder,
and aggregating it into a single byte array and returning that. |
static int |
estimateMaxWorkspaceSize(int inputSize)
Helper method that can be used to estimate maximum space needed to
try compression of given amount of data.
|
static int |
safeAppendEncoded(byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr)
Alternate version that accepts pre-allocated output buffer.
|
static int |
safeAppendEncoded(byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr,
BufferRecycler bufferRecycler)
Alternate version that accepts pre-allocated output buffer.
|
static byte[] |
safeEncode(byte[] data)
Method that will use "safe"
ChunkEncoder, as produced by
ChunkEncoderFactory.safeInstance(), for encoding. |
static byte[] |
safeEncode(byte[] data,
int offset,
int length)
Method that will use "safe"
ChunkEncoder, as produced by
ChunkEncoderFactory.safeInstance(), for encoding. |
static byte[] |
safeEncode(byte[] data,
int offset,
int length,
BufferRecycler bufferRecycler)
Method that will use "safe"
ChunkEncoder, as produced by
ChunkEncoderFactory.safeInstance(), for encoding. |
public static final int MAX_CHUNK_RESULT_SIZE
public static int estimateMaxWorkspaceSize(int inputSize)
public static byte[] encode(byte[] data)
Note that ChunkEncoder instance used is one produced by
ChunkEncoderFactory.optimalInstance(), which typically
is "unsafe" instance if one can be used on current JVM.
public static byte[] safeEncode(byte[] data)
ChunkEncoder, as produced by
ChunkEncoderFactory.safeInstance(), for encoding. Safe here
means that it does not use any non-compliant features beyond core JDK.public static byte[] encode(byte[] data,
int offset,
int length)
Note that ChunkEncoder instance used is one produced by
ChunkEncoderFactory.optimalInstance(), which typically
is "unsafe" instance if one can be used on current JVM.
public static byte[] safeEncode(byte[] data,
int offset,
int length)
ChunkEncoder, as produced by
ChunkEncoderFactory.safeInstance(), for encoding. Safe here
means that it does not use any non-compliant features beyond core JDK.public static byte[] encode(byte[] data,
int offset,
int length,
BufferRecycler bufferRecycler)
Note that ChunkEncoder instance used is one produced by
ChunkEncoderFactory.optimalInstance(), which typically
is "unsafe" instance if one can be used on current JVM.
public static byte[] safeEncode(byte[] data,
int offset,
int length,
BufferRecycler bufferRecycler)
ChunkEncoder, as produced by
ChunkEncoderFactory.safeInstance(), for encoding. Safe here
means that it does not use any non-compliant features beyond core JDK.public static byte[] encode(ChunkEncoder enc, byte[] data, int length)
ChunkEncoder for actual
encoding.public static byte[] encode(ChunkEncoder enc, byte[] data, int offset, int length)
ChunkEncoder,
and aggregating it into a single byte array and returning that.
NOTE: method does NOT call ChunkEncoder.close(); caller is responsible
for doing that after it is done using the encoder.
public static int appendEncoded(byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr)
Note that ChunkEncoder instance used is one produced by
ChunkEncoderFactory.optimalNonAllocatingInstance(int), which typically
is "unsafe" instance if one can be used on current JVM.
public static int safeAppendEncoded(byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr)
Method that will use "safe" ChunkEncoder, as produced by
ChunkEncoderFactory.safeInstance(), for encoding. Safe here
means that it does not use any non-compliant features beyond core JDK.
public static int appendEncoded(byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr,
BufferRecycler bufferRecycler)
Note that ChunkEncoder instance used is one produced by
ChunkEncoderFactory.optimalNonAllocatingInstance(int), which typically
is "unsafe" instance if one can be used on current JVM.
public static int safeAppendEncoded(byte[] input,
int inputPtr,
int inputLength,
byte[] outputBuffer,
int outputPtr,
BufferRecycler bufferRecycler)
Method that will use "safe" ChunkEncoder, as produced by
ChunkEncoderFactory.safeInstance(), for encoding. Safe here
means that it does not use any non-compliant features beyond core JDK.
public static int appendEncoded(ChunkEncoder enc, byte[] input, int inputPtr, int inputLength, byte[] outputBuffer, int outputPtr)
Copyright © 2023 FasterXML. All rights reserved.