public class lz4 extends lz4
Modifier and Type | Field and Description |
---|---|
static int |
LZ4_FREESTANDING |
static int |
LZ4_HEAPMODE
LZ4_FREESTANDING :
When this macro is set to 1, it enables "freestanding mode" that is
suitable for typical freestanding environment which doesn't support
standard C library.
|
static int |
LZ4_MAX_INPUT_SIZE |
static int |
LZ4_MEMORY_USAGE
LZ4_MEMORY_USAGE :
Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; )
Increasing memory usage improves compression ratio, at the cost of speed.
|
static int |
LZ4_MEMORY_USAGE_DEFAULT |
static int |
LZ4_MEMORY_USAGE_MAX |
static int |
LZ4_MEMORY_USAGE_MIN |
static int |
LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION |
static int |
LZ4_VERSION_MAJOR |
static int |
LZ4_VERSION_MINOR |
static int |
LZ4_VERSION_NUMBER |
static int |
LZ4_VERSION_RELEASE |
static BytePointer |
LZ4_VERSION_STRING |
static int |
LZ4F_BLOCK_CHECKSUM_SIZE |
static int |
LZ4F_BLOCK_HEADER_SIZE |
static int |
LZ4F_blockChecksumEnabled
enum LZ4F_blockChecksum_t
|
static int |
LZ4F_blockIndependent
enum LZ4F_blockMode_t
|
static int |
LZ4F_blockLinked
enum LZ4F_blockMode_t
|
static int |
LZ4F_CONTENT_CHECKSUM_SIZE |
static int |
LZ4F_contentChecksumEnabled
enum LZ4F_contentChecksum_t
|
static int |
LZ4F_default
enum LZ4F_blockSizeID_t
|
static int |
LZ4F_frame
enum LZ4F_frameType_t
|
static int |
LZ4F_HEADER_SIZE_MAX |
static int |
LZ4F_HEADER_SIZE_MIN |
static int |
LZ4F_MAGIC_SKIPPABLE_START |
static int |
LZ4F_MAGICNUMBER |
static int |
LZ4F_max1MB
enum LZ4F_blockSizeID_t
|
static int |
LZ4F_max256KB
enum LZ4F_blockSizeID_t
|
static int |
LZ4F_max4MB
enum LZ4F_blockSizeID_t
|
static int |
LZ4F_max64KB
enum LZ4F_blockSizeID_t
|
static int |
LZ4F_MIN_SIZE_TO_KNOW_HEADER_LENGTH |
static int |
LZ4F_noBlockChecksum
enum LZ4F_blockChecksum_t
|
static int |
LZ4F_noContentChecksum
enum LZ4F_contentChecksum_t
|
static int |
LZ4F_skippableFrame
enum LZ4F_frameType_t
|
static int |
LZ4F_VERSION |
static int |
LZ4HC_CLEVEL_DEFAULT |
static int |
LZ4HC_CLEVEL_MAX |
static int |
LZ4HC_CLEVEL_MIN |
static int |
LZ4HC_CLEVEL_OPT_MIN |
static int |
LZ4HC_HEAPMODE |
Constructor and Description |
---|
lz4() |
Modifier and Type | Method and Description |
---|---|
static int |
LZ4_compress_default(BytePointer src,
byte[] dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_compress_default(BytePointer src,
ByteBuffer dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_compress_default(BytePointer src,
BytePointer dst,
int srcSize,
int dstCapacity)
LZ4_compress_default() :
Compresses 'srcSize' bytes from buffer 'src'
into already allocated 'dst' buffer of size 'dstCapacity'.
|
static int |
LZ4_compress_default(String src,
byte[] dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_compress_default(String src,
ByteBuffer dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_compress_default(String src,
BytePointer dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_compress_destSize(BytePointer src,
byte[] dst,
int[] srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_destSize(BytePointer src,
ByteBuffer dst,
IntBuffer srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_destSize(BytePointer src,
BytePointer dst,
IntPointer srcSizePtr,
int targetDstSize)
LZ4_compress_destSize() :
Reverse the logic : compresses as much data as possible from 'src' buffer
into already allocated buffer 'dst', of size >= 'targetDestSize'.
|
static int |
LZ4_compress_destSize(String src,
byte[] dst,
int[] srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_destSize(String src,
ByteBuffer dst,
IntBuffer srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_destSize(String src,
BytePointer dst,
IntPointer srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_fast_continue(LZ4Stream streamPtr,
BytePointer src,
byte[] dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_continue(LZ4Stream streamPtr,
BytePointer src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_continue(LZ4Stream streamPtr,
BytePointer src,
BytePointer dst,
int srcSize,
int dstCapacity,
int acceleration)
LZ4_compress_fast_continue() :
Compress 'src' content using data from previously compressed blocks, for better compression ratio.
|
static int |
LZ4_compress_fast_continue(LZ4Stream streamPtr,
String src,
byte[] dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_continue(LZ4Stream streamPtr,
String src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_continue(LZ4Stream streamPtr,
String src,
BytePointer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_extState(Pointer state,
BytePointer src,
byte[] dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_extState(Pointer state,
BytePointer src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_extState(Pointer state,
BytePointer src,
BytePointer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_extState(Pointer state,
String src,
byte[] dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_extState(Pointer state,
String src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast_extState(Pointer state,
String src,
BytePointer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast(BytePointer src,
byte[] dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast(BytePointer src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast(BytePointer src,
BytePointer dst,
int srcSize,
int dstCapacity,
int acceleration)
LZ4_compress_fast() :
Same as LZ4_compress_default(), but allows selection of "acceleration" factor.
|
static int |
LZ4_compress_fast(String src,
byte[] dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast(String src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_fast(String src,
BytePointer dst,
int srcSize,
int dstCapacity,
int acceleration) |
static int |
LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr,
BytePointer src,
byte[] dst,
int[] srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr,
BytePointer src,
ByteBuffer dst,
IntBuffer srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr,
BytePointer src,
BytePointer dst,
IntPointer srcSizePtr,
int targetDstSize)
LZ4_compress_HC_continue_destSize() : v1.9.0+
Similar to LZ4_compress_HC_continue(),
but will read as much data as possible from
src
to fit into targetDstSize budget. |
static int |
LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr,
String src,
byte[] dst,
int[] srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr,
String src,
ByteBuffer dst,
IntBuffer srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr,
String src,
BytePointer dst,
IntPointer srcSizePtr,
int targetDstSize) |
static int |
LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr,
BytePointer src,
byte[] dst,
int srcSize,
int maxDstSize) |
static int |
LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr,
BytePointer src,
ByteBuffer dst,
int srcSize,
int maxDstSize) |
static int |
LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr,
BytePointer src,
BytePointer dst,
int srcSize,
int maxDstSize) |
static int |
LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr,
String src,
byte[] dst,
int srcSize,
int maxDstSize) |
static int |
LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr,
String src,
ByteBuffer dst,
int srcSize,
int maxDstSize) |
static int |
LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr,
String src,
BytePointer dst,
int srcSize,
int maxDstSize) |
static int |
LZ4_compress_HC_destSize(Pointer stateHC,
BytePointer src,
byte[] dst,
int[] srcSizePtr,
int targetDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_destSize(Pointer stateHC,
BytePointer src,
ByteBuffer dst,
IntBuffer srcSizePtr,
int targetDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_destSize(Pointer stateHC,
BytePointer src,
BytePointer dst,
IntPointer srcSizePtr,
int targetDstSize,
int compressionLevel)
LZ4_compress_HC_destSize() : v1.9.0+
Will compress as much data as possible from
src
to fit into targetDstSize budget. |
static int |
LZ4_compress_HC_destSize(Pointer stateHC,
String src,
byte[] dst,
int[] srcSizePtr,
int targetDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_destSize(Pointer stateHC,
String src,
ByteBuffer dst,
IntBuffer srcSizePtr,
int targetDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_destSize(Pointer stateHC,
String src,
BytePointer dst,
IntPointer srcSizePtr,
int targetDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_extStateHC(Pointer stateHC,
BytePointer src,
byte[] dst,
int srcSize,
int maxDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_extStateHC(Pointer stateHC,
BytePointer src,
ByteBuffer dst,
int srcSize,
int maxDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_extStateHC(Pointer stateHC,
BytePointer src,
BytePointer dst,
int srcSize,
int maxDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_extStateHC(Pointer stateHC,
String src,
byte[] dst,
int srcSize,
int maxDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_extStateHC(Pointer stateHC,
String src,
ByteBuffer dst,
int srcSize,
int maxDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC_extStateHC(Pointer stateHC,
String src,
BytePointer dst,
int srcSize,
int maxDstSize,
int compressionLevel) |
static int |
LZ4_compress_HC(BytePointer src,
byte[] dst,
int srcSize,
int dstCapacity,
int compressionLevel) |
static int |
LZ4_compress_HC(BytePointer src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
int compressionLevel) |
static int |
LZ4_compress_HC(BytePointer src,
BytePointer dst,
int srcSize,
int dstCapacity,
int compressionLevel)
LZ4_compress_HC() :
Compress data from
src into dst , using the powerful but slower "HC" algorithm. |
static int |
LZ4_compress_HC(String src,
byte[] dst,
int srcSize,
int dstCapacity,
int compressionLevel) |
static int |
LZ4_compress_HC(String src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
int compressionLevel) |
static int |
LZ4_compress_HC(String src,
BytePointer dst,
int srcSize,
int dstCapacity,
int compressionLevel) |
static int |
LZ4_compressBound(int inputSize)
LZ4_compressBound() :
Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible)
This function is primarily useful for memory allocation purposes (destination buffer size).
|
static LZ4Stream |
LZ4_createStream()
Note about RC_INVOKED
|
static LZ4StreamDecode |
LZ4_createStreamDecode()
LZ4_createStreamDecode() and LZ4_freeStreamDecode() :
creation / destruction of streaming decompression tracking context.
|
static LZ4StreamHC |
LZ4_createStreamHC()
LZ4_createStreamHC() and LZ4_freeStreamHC() :
These functions create and release memory for LZ4 HC streaming state.
|
static int |
LZ4_decoderRingBufferSize(int maxBlockSize)
LZ4_decoderRingBufferSize() : v1.8.2+
Note : in a ring buffer scenario (optional),
blocks are presumed decompressed next to each other
up to the moment there is not enough remaining space for next block (remainingSize < maxBlockSize),
at which stage it resumes from beginning of ring buffer.
|
static int |
LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode,
BytePointer src,
byte[] dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode,
BytePointer src,
ByteBuffer dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode,
BytePointer src,
BytePointer dst,
int srcSize,
int dstCapacity)
LZ4_decompress_*_continue() :
These decoding functions allow decompression of consecutive blocks in "streaming" mode.
|
static int |
LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode,
String src,
byte[] dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode,
String src,
ByteBuffer dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode,
String src,
BytePointer dst,
int srcSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_partial_usingDict(BytePointer src,
byte[] dst,
int compressedSize,
int targetOutputSize,
int maxOutputSize,
BytePointer dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_partial_usingDict(BytePointer src,
ByteBuffer dst,
int compressedSize,
int targetOutputSize,
int maxOutputSize,
BytePointer dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_partial_usingDict(BytePointer src,
BytePointer dst,
int compressedSize,
int targetOutputSize,
int maxOutputSize,
BytePointer dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_partial_usingDict(String src,
byte[] dst,
int compressedSize,
int targetOutputSize,
int maxOutputSize,
String dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_partial_usingDict(String src,
ByteBuffer dst,
int compressedSize,
int targetOutputSize,
int maxOutputSize,
String dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_partial_usingDict(String src,
BytePointer dst,
int compressedSize,
int targetOutputSize,
int maxOutputSize,
String dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_partial(BytePointer src,
byte[] dst,
int srcSize,
int targetOutputSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_partial(BytePointer src,
ByteBuffer dst,
int srcSize,
int targetOutputSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_partial(BytePointer src,
BytePointer dst,
int srcSize,
int targetOutputSize,
int dstCapacity)
LZ4_decompress_safe_partial() :
Decompress an LZ4 compressed block, of size 'srcSize' at position 'src',
into destination buffer 'dst' of size 'dstCapacity'.
|
static int |
LZ4_decompress_safe_partial(String src,
byte[] dst,
int srcSize,
int targetOutputSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_partial(String src,
ByteBuffer dst,
int srcSize,
int targetOutputSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_partial(String src,
BytePointer dst,
int srcSize,
int targetOutputSize,
int dstCapacity) |
static int |
LZ4_decompress_safe_usingDict(BytePointer src,
byte[] dst,
int srcSize,
int dstCapacity,
BytePointer dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_usingDict(BytePointer src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
BytePointer dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_usingDict(BytePointer src,
BytePointer dst,
int srcSize,
int dstCapacity,
BytePointer dictStart,
int dictSize)
LZ4_decompress_*_usingDict() :
These decoding functions work the same as
a combination of LZ4_setStreamDecode() followed by LZ4_decompress_*_continue()
They are stand-alone, and don't need an LZ4_streamDecode_t structure.
|
static int |
LZ4_decompress_safe_usingDict(String src,
byte[] dst,
int srcSize,
int dstCapacity,
String dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_usingDict(String src,
ByteBuffer dst,
int srcSize,
int dstCapacity,
String dictStart,
int dictSize) |
static int |
LZ4_decompress_safe_usingDict(String src,
BytePointer dst,
int srcSize,
int dstCapacity,
String dictStart,
int dictSize) |
static int |
LZ4_decompress_safe(BytePointer src,
byte[] dst,
int compressedSize,
int dstCapacity) |
static int |
LZ4_decompress_safe(BytePointer src,
ByteBuffer dst,
int compressedSize,
int dstCapacity) |
static int |
LZ4_decompress_safe(BytePointer src,
BytePointer dst,
int compressedSize,
int dstCapacity)
LZ4_decompress_safe() :
compressedSize : is the exact complete size of the compressed block.
|
static int |
LZ4_decompress_safe(String src,
byte[] dst,
int compressedSize,
int dstCapacity) |
static int |
LZ4_decompress_safe(String src,
ByteBuffer dst,
int compressedSize,
int dstCapacity) |
static int |
LZ4_decompress_safe(String src,
BytePointer dst,
int compressedSize,
int dstCapacity) |
static int |
LZ4_freeStream(LZ4Stream streamPtr) |
static int |
LZ4_freeStreamDecode(LZ4StreamDecode LZ4_stream) |
static int |
LZ4_freeStreamHC(LZ4StreamHC streamHCPtr) |
static int |
LZ4_loadDict(LZ4Stream streamPtr,
BytePointer dictionary,
int dictSize)
LZ4_loadDict() :
Use this function to reference a static dictionary into LZ4_stream_t.
|
static int |
LZ4_loadDict(LZ4Stream streamPtr,
String dictionary,
int dictSize) |
static int |
LZ4_loadDictHC(LZ4StreamHC streamHCPtr,
BytePointer dictionary,
int dictSize) |
static int |
LZ4_loadDictHC(LZ4StreamHC streamHCPtr,
String dictionary,
int dictSize) |
static void |
LZ4_resetStream_fast(LZ4Stream streamPtr)
LZ4_resetStream_fast() : v1.9.0+
Use this to prepare an LZ4_stream_t for a new chain of dependent blocks
(e.g., LZ4_compress_fast_continue()).
|
static void |
LZ4_resetStreamHC_fast(LZ4StreamHC streamHCPtr,
int compressionLevel) |
static int |
LZ4_saveDict(LZ4Stream streamPtr,
byte[] safeBuffer,
int maxDictSize) |
static int |
LZ4_saveDict(LZ4Stream streamPtr,
ByteBuffer safeBuffer,
int maxDictSize) |
static int |
LZ4_saveDict(LZ4Stream streamPtr,
BytePointer safeBuffer,
int maxDictSize)
LZ4_saveDict() :
If last 64KB data cannot be guaranteed to remain available at its current memory location,
save it into a safer place (char* safeBuffer).
|
static int |
LZ4_saveDictHC(LZ4StreamHC streamHCPtr,
byte[] safeBuffer,
int maxDictSize) |
static int |
LZ4_saveDictHC(LZ4StreamHC streamHCPtr,
ByteBuffer safeBuffer,
int maxDictSize) |
static int |
LZ4_saveDictHC(LZ4StreamHC streamHCPtr,
BytePointer safeBuffer,
int maxDictSize) |
static int |
LZ4_setStreamDecode(LZ4StreamDecode LZ4_streamDecode,
BytePointer dictionary,
int dictSize)
LZ4_setStreamDecode() :
An LZ4_streamDecode_t context can be allocated once and re-used multiple times.
|
static int |
LZ4_setStreamDecode(LZ4StreamDecode LZ4_streamDecode,
String dictionary,
int dictSize) |
static int |
LZ4_sizeofState()
LZ4_compress_fast_extState() :
Same as LZ4_compress_fast(), using an externally allocated memory space for its state.
|
static int |
LZ4_sizeofStateHC()
LZ4_compress_HC_extStateHC() :
Same as LZ4_compress_HC(), but using an externally allocated memory segment for
state . |
static BytePointer |
LZ4_VERSION_STRING() |
static int |
LZ4_versionNumber()
library version number; useful to check dll version; requires v1.3.0+
|
static BytePointer |
LZ4_versionString()
library version string; useful to check dll version; requires v1.7.5+
|
static long |
LZ4F_compressBegin(LZ4FCompressionContext cctx,
Pointer dstBuffer,
long dstCapacity,
LZ4FPreferences prefsPtr)
LZ4F_compressBegin() :
will write the frame header into dstBuffer.
|
static long |
LZ4F_compressBound(long srcSize,
LZ4FPreferences prefsPtr)
LZ4F_compressBound() :
Provides minimum dstCapacity required to guarantee success of
LZ4F_compressUpdate(), given a srcSize and preferences, for a worst case scenario.
|
static long |
LZ4F_compressEnd(LZ4FCompressionContext cctx,
Pointer dstBuffer,
long dstCapacity,
LZ4FCompressOptions cOptPtr)
LZ4F_compressEnd() :
To properly finish an LZ4 frame, invoke LZ4F_compressEnd().
|
static long |
LZ4F_compressFrame(Pointer dstBuffer,
long dstCapacity,
Pointer srcBuffer,
long srcSize,
LZ4FPreferences preferencesPtr)
LZ4F_compressFrame() :
Compress an entire srcBuffer into a valid LZ4 frame.
|
static long |
LZ4F_compressFrameBound(long srcSize,
LZ4FPreferences preferencesPtr)
LZ4F_compressFrameBound() :
Returns the maximum possible compressed size with LZ4F_compressFrame() given srcSize and preferences.
|
static int |
LZ4F_compressionLevel_max() |
static long |
LZ4F_compressUpdate(LZ4FCompressionContext cctx,
Pointer dstBuffer,
long dstCapacity,
Pointer srcBuffer,
long srcSize,
LZ4FCompressOptions cOptPtr)
LZ4F_compressUpdate() :
LZ4F_compressUpdate() can be called repetitively to compress as much data as necessary.
|
static long |
LZ4F_createCompressionContext(LZ4FCompressionContext cctxPtr,
int version) |
static long |
LZ4F_createCompressionContext(PointerPointer cctxPtr,
int version)
LZ4F_createCompressionContext() :
The first thing to do is to create a compressionContext object,
which will keep track of operation state during streaming compression.
|
static long |
LZ4F_createDecompressionContext(LZ4FDecompressionContext dctxPtr,
int version) |
static long |
LZ4F_createDecompressionContext(PointerPointer dctxPtr,
int version)
LZ4F_createDecompressionContext() :
Create an LZ4F_dctx object, to track all decompression operations.
|
static long |
LZ4F_decompress(LZ4FDecompressionContext dctx,
Pointer dstBuffer,
SizeTPointer dstSizePtr,
Pointer srcBuffer,
SizeTPointer srcSizePtr,
LZ4FDecompressOptions dOptPtr)
LZ4F_decompress() :
Call this function repetitively to regenerate data compressed in
srcBuffer . |
static long |
LZ4F_flush(LZ4FCompressionContext cctx,
Pointer dstBuffer,
long dstCapacity,
LZ4FCompressOptions cOptPtr)
LZ4F_flush() :
When data must be generated and sent immediately, without waiting for a block to be completely filled,
it's possible to call LZ4_flush().
|
static long |
LZ4F_freeCompressionContext(LZ4FCompressionContext cctx) |
static long |
LZ4F_freeDecompressionContext(LZ4FDecompressionContext dctx) |
static BytePointer |
LZ4F_getErrorName(long code)
return error code string; for debugging
|
static long |
LZ4F_getFrameInfo(LZ4FDecompressionContext dctx,
LZ4FFrameInfo frameInfoPtr,
Pointer srcBuffer,
SizeTPointer srcSizePtr)
LZ4F_getFrameInfo() :
This function extracts frame parameters (max blockSize, dictID, etc.).
|
static int |
LZ4F_getVersion() |
static long |
LZ4F_headerSize(Pointer src,
long srcSize)
LZ4F_headerSize() : v1.9.0+
Provide the header size of a frame starting at
src . |
static int |
LZ4F_isError(long code)
tells when a function result is an error code
|
static void |
LZ4F_resetDecompressionContext(LZ4FDecompressionContext dctx)
LZ4F_resetDecompressionContext() : added in v1.8.0
In case of an error, the context is left in "undefined" state.
|
LZ4F_INIT_FRAMEINFO, LZ4F_INIT_PREFERENCES, map
public static final int LZ4_HEAPMODE
public static final int LZ4HC_HEAPMODE
public static final int LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION
public static final int LZ4_FREESTANDING
public static final int LZ4_VERSION_MAJOR
public static final int LZ4_VERSION_MINOR
public static final int LZ4_VERSION_RELEASE
public static final int LZ4_VERSION_NUMBER
public static final BytePointer LZ4_VERSION_STRING
public static final int LZ4_MEMORY_USAGE_MIN
public static final int LZ4_MEMORY_USAGE_DEFAULT
public static final int LZ4_MEMORY_USAGE_MAX
public static final int LZ4_MEMORY_USAGE
public static final int LZ4_MAX_INPUT_SIZE
public static final int LZ4HC_CLEVEL_MIN
public static final int LZ4HC_CLEVEL_DEFAULT
public static final int LZ4HC_CLEVEL_OPT_MIN
public static final int LZ4HC_CLEVEL_MAX
public static final int LZ4F_default
public static final int LZ4F_max64KB
public static final int LZ4F_max256KB
public static final int LZ4F_max1MB
public static final int LZ4F_max4MB
public static final int LZ4F_blockLinked
public static final int LZ4F_blockIndependent
public static final int LZ4F_noContentChecksum
public static final int LZ4F_contentChecksumEnabled
public static final int LZ4F_noBlockChecksum
public static final int LZ4F_blockChecksumEnabled
public static final int LZ4F_frame
public static final int LZ4F_skippableFrame
public static final int LZ4F_VERSION
public static final int LZ4F_HEADER_SIZE_MIN
public static final int LZ4F_HEADER_SIZE_MAX
public static final int LZ4F_BLOCK_HEADER_SIZE
public static final int LZ4F_BLOCK_CHECKSUM_SIZE
public static final int LZ4F_CONTENT_CHECKSUM_SIZE
public static final int LZ4F_MAGICNUMBER
public static final int LZ4F_MAGIC_SKIPPABLE_START
public static final int LZ4F_MIN_SIZE_TO_KNOW_HEADER_LENGTH
@MemberGetter @Cast(value="const char*") public static BytePointer LZ4_VERSION_STRING()
public static int LZ4_versionNumber()
@Cast(value="const char*") public static BytePointer LZ4_versionString()
public static int LZ4_compress_default(@Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity)
public static int LZ4_compress_default(String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity)
public static int LZ4_compress_default(@Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity)
public static int LZ4_compress_default(String src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity)
public static int LZ4_compress_default(@Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity)
public static int LZ4_compress_default(String src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity)
public static int LZ4_decompress_safe(@Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int compressedSize, int dstCapacity)
public static int LZ4_decompress_safe(String src, @Cast(value="char*") ByteBuffer dst, int compressedSize, int dstCapacity)
public static int LZ4_decompress_safe(@Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int compressedSize, int dstCapacity)
public static int LZ4_decompress_safe(String src, @Cast(value="char*") BytePointer dst, int compressedSize, int dstCapacity)
public static int LZ4_decompress_safe(@Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int compressedSize, int dstCapacity)
public static int LZ4_decompress_safe(String src, @Cast(value="char*") byte[] dst, int compressedSize, int dstCapacity)
public static int LZ4_compressBound(int inputSize)
public static int LZ4_compress_fast(@Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast(String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast(@Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast(String src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast(@Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast(String src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_sizeofState()
malloc()
typically).
Then, provide this buffer as void* state
to compression function.public static int LZ4_compress_fast_extState(Pointer state, @Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_extState(Pointer state, String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_extState(Pointer state, @Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_extState(Pointer state, String src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_extState(Pointer state, @Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_extState(Pointer state, String src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_destSize(@Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, IntPointer srcSizePtr, int targetDstSize)
LZ4_compress_destSize()
,
it's highly recommended to update liblz4 to v1.9.2 or better.
If this can't be done or ensured,
the receiving decompression function should provide
a dstCapacity which is > decompressedSize, by at least 1 byte.
See https://github.com/lz4/lz4/issues/859 for detailspublic static int LZ4_compress_destSize(String src, @Cast(value="char*") ByteBuffer dst, IntBuffer srcSizePtr, int targetDstSize)
public static int LZ4_compress_destSize(@Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int[] srcSizePtr, int targetDstSize)
public static int LZ4_compress_destSize(String src, @Cast(value="char*") BytePointer dst, IntPointer srcSizePtr, int targetDstSize)
public static int LZ4_compress_destSize(@Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, IntBuffer srcSizePtr, int targetDstSize)
public static int LZ4_compress_destSize(String src, @Cast(value="char*") byte[] dst, int[] srcSizePtr, int targetDstSize)
public static int LZ4_decompress_safe_partial(@Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int targetOutputSize, int dstCapacity)
dst
(necessarily <= targetOutputSize)
If source stream is detected malformed, function returns a negative result.
Note 1 : @return can be < targetOutputSize, if compressed block contains less data.
Note 2 : targetOutputSize must be <= dstCapacity
Note 3 : this function effectively stops decoding on reaching targetOutputSize,
so dstCapacity is kind of redundant.
This is because in older versions of this function,
decoding operation would still write complete sequences.
Therefore, there was no guarantee that it would stop writing at exactly targetOutputSize,
it could write more bytes, though only up to dstCapacity.
Some "margin" used to be required for this operation to work properly.
Thankfully, this is no longer necessary.
The function nonetheless keeps the same signature, in an effort to preserve API compatibility.
Note 4 : If srcSize is the exact size of the block,
then targetOutputSize can be any value,
including larger than the block's decompressed size.
The function will, at most, generate block's decompressed size.
Note 5 : If srcSize is _larger_ than block's compressed size,
then targetOutputSize **MUST** be <= block's decompressed size.
Otherwise, *silent corruption will occur*.public static int LZ4_decompress_safe_partial(String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int targetOutputSize, int dstCapacity)
public static int LZ4_decompress_safe_partial(@Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int targetOutputSize, int dstCapacity)
public static int LZ4_decompress_safe_partial(String src, @Cast(value="char*") BytePointer dst, int srcSize, int targetOutputSize, int dstCapacity)
public static int LZ4_decompress_safe_partial(@Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int targetOutputSize, int dstCapacity)
public static int LZ4_decompress_safe_partial(String src, @Cast(value="char*") byte[] dst, int srcSize, int targetOutputSize, int dstCapacity)
public static LZ4Stream LZ4_createStream()
- RC_INVOKED is predefined symbol of rc.exe (the resource compiler which is part of MSVC/Visual Studio). https://docs.microsoft.com/en-us/windows/win32/menurc/predefined-macros
- Since rc.exe is a legacy compiler, it truncates long symbol (> 30 chars) and reports warning "RC4011: identifier truncated".
- To eliminate the warning, we surround long preprocessor symbol with "#if !defined(RC_INVOKED) ... #endif" block that means "skip this block when rc.exe is trying to read it".
public static int LZ4_freeStream(LZ4Stream streamPtr)
public static void LZ4_resetStream_fast(LZ4Stream streamPtr)
public static int LZ4_loadDict(LZ4Stream streamPtr, @Cast(value="const char*") BytePointer dictionary, int dictSize)
public static int LZ4_compress_fast_continue(LZ4Stream streamPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_continue(LZ4Stream streamPtr, String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_continue(LZ4Stream streamPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_continue(LZ4Stream streamPtr, String src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_continue(LZ4Stream streamPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_compress_fast_continue(LZ4Stream streamPtr, String src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, int acceleration)
public static int LZ4_saveDict(LZ4Stream streamPtr, @Cast(value="char*") BytePointer safeBuffer, int maxDictSize)
public static int LZ4_saveDict(LZ4Stream streamPtr, @Cast(value="char*") ByteBuffer safeBuffer, int maxDictSize)
public static int LZ4_saveDict(LZ4Stream streamPtr, @Cast(value="char*") byte[] safeBuffer, int maxDictSize)
public static LZ4StreamDecode LZ4_createStreamDecode()
public static int LZ4_freeStreamDecode(LZ4StreamDecode LZ4_stream)
public static int LZ4_setStreamDecode(LZ4StreamDecode LZ4_streamDecode, @Cast(value="const char*") BytePointer dictionary, int dictSize)
public static int LZ4_setStreamDecode(LZ4StreamDecode LZ4_streamDecode, String dictionary, int dictSize)
public static int LZ4_decoderRingBufferSize(int maxBlockSize)
public static int LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode, @Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity)
public static int LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode, String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity)
public static int LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode, @Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity)
public static int LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode, String src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity)
public static int LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode, @Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity)
public static int LZ4_decompress_safe_continue(LZ4StreamDecode LZ4_streamDecode, String src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity)
public static int LZ4_decompress_safe_usingDict(@Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, @Cast(value="const char*") BytePointer dictStart, int dictSize)
public static int LZ4_decompress_safe_usingDict(String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, String dictStart, int dictSize)
public static int LZ4_decompress_safe_usingDict(@Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, @Cast(value="const char*") BytePointer dictStart, int dictSize)
public static int LZ4_decompress_safe_usingDict(String src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, String dictStart, int dictSize)
public static int LZ4_decompress_safe_usingDict(@Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, @Cast(value="const char*") BytePointer dictStart, int dictSize)
public static int LZ4_decompress_safe_usingDict(String src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, String dictStart, int dictSize)
public static int LZ4_decompress_safe_partial_usingDict(@Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int compressedSize, int targetOutputSize, int maxOutputSize, @Cast(value="const char*") BytePointer dictStart, int dictSize)
public static int LZ4_decompress_safe_partial_usingDict(String src, @Cast(value="char*") ByteBuffer dst, int compressedSize, int targetOutputSize, int maxOutputSize, String dictStart, int dictSize)
public static int LZ4_decompress_safe_partial_usingDict(@Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int compressedSize, int targetOutputSize, int maxOutputSize, @Cast(value="const char*") BytePointer dictStart, int dictSize)
public static int LZ4_decompress_safe_partial_usingDict(String src, @Cast(value="char*") BytePointer dst, int compressedSize, int targetOutputSize, int maxOutputSize, String dictStart, int dictSize)
public static int LZ4_decompress_safe_partial_usingDict(@Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int compressedSize, int targetOutputSize, int maxOutputSize, @Cast(value="const char*") BytePointer dictStart, int dictSize)
public static int LZ4_decompress_safe_partial_usingDict(String src, @Cast(value="char*") byte[] dst, int compressedSize, int targetOutputSize, int maxOutputSize, String dictStart, int dictSize)
public static int LZ4_compress_HC(@Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, int compressionLevel)
src
into dst
, using the powerful but slower "HC" algorithm.
dst
must be already allocated.
Compression is guaranteed to succeed if dstCapacity >= LZ4_compressBound(srcSize)
(see "lz4.h")
Max supported srcSize
value is LZ4_MAX_INPUT_SIZE (see "lz4.h")
compressionLevel
: any value between 1 and LZ4HC_CLEVEL_MAX will work.
Values > LZ4HC_CLEVEL_MAX behave the same as LZ4HC_CLEVEL_MAX.public static int LZ4_compress_HC(String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, int compressionLevel)
public static int LZ4_compress_HC(@Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, int compressionLevel)
public static int LZ4_compress_HC(String src, @Cast(value="char*") BytePointer dst, int srcSize, int dstCapacity, int compressionLevel)
public static int LZ4_compress_HC(@Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int dstCapacity, int compressionLevel)
public static int LZ4_compress_HC(String src, @Cast(value="char*") byte[] dst, int srcSize, int dstCapacity, int compressionLevel)
public static int LZ4_sizeofStateHC()
state
.
state
size is provided by LZ4_sizeofStateHC().
Memory segment must be aligned on 8-bytes boundaries (which a normal malloc() should do properly).public static int LZ4_compress_HC_extStateHC(Pointer stateHC, @Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int maxDstSize, int compressionLevel)
public static int LZ4_compress_HC_extStateHC(Pointer stateHC, String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int maxDstSize, int compressionLevel)
public static int LZ4_compress_HC_extStateHC(Pointer stateHC, @Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int maxDstSize, int compressionLevel)
public static int LZ4_compress_HC_extStateHC(Pointer stateHC, String src, @Cast(value="char*") BytePointer dst, int srcSize, int maxDstSize, int compressionLevel)
public static int LZ4_compress_HC_extStateHC(Pointer stateHC, @Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int maxDstSize, int compressionLevel)
public static int LZ4_compress_HC_extStateHC(Pointer stateHC, String src, @Cast(value="char*") byte[] dst, int srcSize, int maxDstSize, int compressionLevel)
public static int LZ4_compress_HC_destSize(Pointer stateHC, @Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, IntPointer srcSizePtr, int targetDstSize, int compressionLevel)
src
to fit into targetDstSize
budget.
Result is provided in 2 parts :srcSizePtr
: on success, *srcSizePtr is updated to indicate how much bytes were read from src
public static int LZ4_compress_HC_destSize(Pointer stateHC, String src, @Cast(value="char*") ByteBuffer dst, IntBuffer srcSizePtr, int targetDstSize, int compressionLevel)
public static int LZ4_compress_HC_destSize(Pointer stateHC, @Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int[] srcSizePtr, int targetDstSize, int compressionLevel)
public static int LZ4_compress_HC_destSize(Pointer stateHC, String src, @Cast(value="char*") BytePointer dst, IntPointer srcSizePtr, int targetDstSize, int compressionLevel)
public static int LZ4_compress_HC_destSize(Pointer stateHC, @Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, IntBuffer srcSizePtr, int targetDstSize, int compressionLevel)
public static int LZ4_compress_HC_destSize(Pointer stateHC, String src, @Cast(value="char*") byte[] dst, int[] srcSizePtr, int targetDstSize, int compressionLevel)
public static LZ4StreamHC LZ4_createStreamHC()
public static int LZ4_freeStreamHC(LZ4StreamHC streamHCPtr)
public static void LZ4_resetStreamHC_fast(LZ4StreamHC streamHCPtr, int compressionLevel)
public static int LZ4_loadDictHC(LZ4StreamHC streamHCPtr, @Cast(value="const char*") BytePointer dictionary, int dictSize)
public static int LZ4_loadDictHC(LZ4StreamHC streamHCPtr, String dictionary, int dictSize)
public static int LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, int srcSize, int maxDstSize)
public static int LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr, String src, @Cast(value="char*") ByteBuffer dst, int srcSize, int maxDstSize)
public static int LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int srcSize, int maxDstSize)
public static int LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr, String src, @Cast(value="char*") BytePointer dst, int srcSize, int maxDstSize)
public static int LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, int srcSize, int maxDstSize)
public static int LZ4_compress_HC_continue(LZ4StreamHC streamHCPtr, String src, @Cast(value="char*") byte[] dst, int srcSize, int maxDstSize)
public static int LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") BytePointer dst, IntPointer srcSizePtr, int targetDstSize)
src
to fit into targetDstSize
budget.
Result is provided into 2 parts :srcSizePtr
: on success, *srcSizePtr will be updated to indicate how much bytes were read from src
.
Note that this function may not consume the entire input.public static int LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr, String src, @Cast(value="char*") ByteBuffer dst, IntBuffer srcSizePtr, int targetDstSize)
public static int LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") byte[] dst, int[] srcSizePtr, int targetDstSize)
public static int LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr, String src, @Cast(value="char*") BytePointer dst, IntPointer srcSizePtr, int targetDstSize)
public static int LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr, @Cast(value="const char*") BytePointer src, @Cast(value="char*") ByteBuffer dst, IntBuffer srcSizePtr, int targetDstSize)
public static int LZ4_compress_HC_continue_destSize(LZ4StreamHC LZ4_streamHCPtr, String src, @Cast(value="char*") byte[] dst, int[] srcSizePtr, int targetDstSize)
public static int LZ4_saveDictHC(LZ4StreamHC streamHCPtr, @Cast(value="char*") BytePointer safeBuffer, int maxDictSize)
public static int LZ4_saveDictHC(LZ4StreamHC streamHCPtr, @Cast(value="char*") ByteBuffer safeBuffer, int maxDictSize)
public static int LZ4_saveDictHC(LZ4StreamHC streamHCPtr, @Cast(value="char*") byte[] safeBuffer, int maxDictSize)
@Cast(value="unsigned") public static int LZ4F_isError(@Cast(value="LZ4F_errorCode_t") long code)
@Cast(value="const char*") public static BytePointer LZ4F_getErrorName(@Cast(value="LZ4F_errorCode_t") long code)
public static int LZ4F_compressionLevel_max()
@Cast(value="size_t") public static long LZ4F_compressFrameBound(@Cast(value="size_t") long srcSize, @Const LZ4FPreferences preferencesPtr)
preferencesPtr
is optional. It can be replaced by NULL, in which case, the function will assume default preferences.
Note : this result is only usable with LZ4F_compressFrame().
It may also be relevant to LZ4F_compressUpdate() _only if_ no flush() operation is ever performed.@Cast(value="size_t") public static long LZ4F_compressFrame(Pointer dstBuffer, @Cast(value="size_t") long dstCapacity, @Const Pointer srcBuffer, @Cast(value="size_t") long srcSize, @Const LZ4FPreferences preferencesPtr)
@Cast(value="LZ4F_errorCode_t") public static long LZ4F_createCompressionContext(@Cast(value="LZ4F_cctx**") PointerPointer cctxPtr, @Cast(value="unsigned") int version)
@Cast(value="LZ4F_errorCode_t") public static long LZ4F_createCompressionContext(@ByPtrPtr LZ4FCompressionContext cctxPtr, @Cast(value="unsigned") int version)
@Cast(value="LZ4F_errorCode_t") public static long LZ4F_freeCompressionContext(LZ4FCompressionContext cctx)
@Cast(value="size_t") public static long LZ4F_compressBegin(LZ4FCompressionContext cctx, Pointer dstBuffer, @Cast(value="size_t") long dstCapacity, @Const LZ4FPreferences prefsPtr)
prefsPtr
is optional : you can provide NULL as argument, all preferences will then be set to default.@Cast(value="size_t") public static long LZ4F_compressBound(@Cast(value="size_t") long srcSize, @Const LZ4FPreferences prefsPtr)
@Cast(value="size_t") public static long LZ4F_compressUpdate(LZ4FCompressionContext cctx, Pointer dstBuffer, @Cast(value="size_t") long dstCapacity, @Const Pointer srcBuffer, @Cast(value="size_t") long srcSize, @Const LZ4FCompressOptions cOptPtr)
cOptPtr
is optional : NULL can be provided, in which case all options are set to default.dstBuffer
(it can be zero, meaning input data was just buffered).
or an error code if it fails (which can be tested using LZ4F_isError())@Cast(value="size_t") public static long LZ4F_flush(LZ4FCompressionContext cctx, Pointer dstBuffer, @Cast(value="size_t") long dstCapacity, @Const LZ4FCompressOptions cOptPtr)
dstCapacity
must be large enough to ensure the operation will be successful.
cOptPtr
is optional : it's possible to provide NULL, all options will be set to default.@Cast(value="size_t") public static long LZ4F_compressEnd(LZ4FCompressionContext cctx, Pointer dstBuffer, @Cast(value="size_t") long dstCapacity, @Const LZ4FCompressOptions cOptPtr)
cctx
(like LZ4_flush())
and properly finalize the frame, with an endMark and a checksum.
cOptPtr
is optional : NULL can be provided, in which case all options will be set to default.cctx
available again for another compression task.@Cast(value="LZ4F_errorCode_t") public static long LZ4F_createDecompressionContext(@Cast(value="LZ4F_dctx**") PointerPointer dctxPtr, @Cast(value="unsigned") int version)
@Cast(value="LZ4F_errorCode_t") public static long LZ4F_createDecompressionContext(@ByPtrPtr LZ4FDecompressionContext dctxPtr, @Cast(value="unsigned") int version)
@Cast(value="LZ4F_errorCode_t") public static long LZ4F_freeDecompressionContext(LZ4FDecompressionContext dctx)
@Cast(value="size_t") public static long LZ4F_headerSize(@Const Pointer src, @Cast(value="size_t") long srcSize)
src
.
srcSize
must be >= LZ4F_MIN_SIZE_TO_KNOW_HEADER_LENGTH,
which is enough to decode the header length.@Cast(value="size_t") public static long LZ4F_getFrameInfo(LZ4FDecompressionContext dctx, LZ4FFrameInfo frameInfoPtr, @Const Pointer srcBuffer, @Cast(value="size_t*") SizeTPointer srcSizePtr)
srcBuffer
,
consuming the header and starting the decoding process.
Input size must be large enough to contain the full frame header.
Frame header size can be known beforehand by LZ4F_headerSize().
Frame header size is variable, but is guaranteed to be >= LZ4F_HEADER_SIZE_MIN bytes,
and not more than <= LZ4F_HEADER_SIZE_MAX bytes.
Hence, blindly providing LZ4F_HEADER_SIZE_MAX bytes or more will always work.
It's allowed to provide more input data than the header size,
LZ4F_getFrameInfo() will only consume the header.
If input size is not large enough,
aka if it's smaller than header size,
function will fail and return an error code.
2) After decoding has been started,
it's possible to invoke LZ4F_getFrameInfo() anytime
to extract already decoded frame parameters stored within dctx.
Note that, if decoding has barely started,
and not yet read enough information to decode the header,
LZ4F_getFrameInfo() will fail.
The number of bytes consumed from srcBuffer will be updated in *srcSizePtr (necessarily <= original value).
LZ4F_getFrameInfo() only consumes bytes when decoding has not yet started,
and when decoding the header has been successful.
Decompression must then resume from (srcBuffer + *srcSizePtr).@Cast(value="size_t") public static long LZ4F_decompress(LZ4FDecompressionContext dctx, Pointer dstBuffer, @Cast(value="size_t*") SizeTPointer dstSizePtr, @Const Pointer srcBuffer, @Cast(value="size_t*") SizeTPointer srcSizePtr, @Const LZ4FDecompressOptions dOptPtr)
srcBuffer
.
The function requires a valid dctx state.
It will read up to *srcSizePtr bytes from srcBuffer,
and decompress data into dstBuffer, of capacity *dstSizePtr.
The nb of bytes consumed from srcBuffer will be written into *srcSizePtr (necessarily <= original value).
The nb of bytes decompressed into dstBuffer will be written into *dstSizePtr (necessarily <= original value).
The function does not necessarily read all input bytes, so always check value in *srcSizePtr.
Unconsumed source data must be presented again in subsequent invocations.
dstBuffer
can freely change between each consecutive function invocation.
dstBuffer
content will be overwritten.srcSize
bytes LZ4F_decompress() expects for next call.
Schematically, it's the size of the current (or remaining) compressed block + header of next block.
Respecting the hint provides some small speed benefit, because it skips intermediate buffers.
This is just a hint though, it's always possible to provide any srcSize.
When a frame is fully decoded, @return will be 0 (no more data expected).
When provided with more bytes than necessary to decode a frame,
LZ4F_decompress() will stop reading exactly at end of current frame, and @return 0.
If decompression failed, @return is an error code, which can be tested using LZ4F_isError().
After a decompression error, the dctx
context is not resumable.
Use LZ4F_resetDecompressionContext() to return to clean state.
After a frame is fully decoded, dctx can be used again to decompress another frame.public static void LZ4F_resetDecompressionContext(LZ4FDecompressionContext dctx)
Copyright © 2022. All rights reserved.