Top Description Fields Constructors Methods
org.lwjgl.util.zstd

public Class ZstdX

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Native bindings to the experimental API of Zstandard (zstd).

Field Summary

Modifier and TypeField and Description
public static final int
ZSTD_BLOCKSIZE_MAX_MIN

The minimum valid max blocksize.

public static final int
ZSTD_c_blockDelimiters

Default is 0 == ZSTD_sf_noBlockDelimiters.

public static final int
ZSTD_c_deterministicRefPrefix

Default is 0 == disabled.

public static final int
ZSTD_c_enableDedicatedDictSearch

Controls whether the new and experimental "dedicated dictionary search structure" can be used.

public static final int
ZSTD_c_enableSeqProducerFallback

Allowed values are 0 (disable) and 1 (enable).

public static final int
ZSTD_c_forceAttachDict

Controls whether the contents of a CDict are used in place, or copied into the working context.

public static final int
ZSTD_c_forceMaxWindow

Force back-reference distances to remain < windowSize, even when referencing into Dictionary content.

public static final int
ZSTD_c_format

Select a compression format.

public static final int
ZSTD_c_literalCompressionMode

Controlled with ZSTD_paramSwitch_e enum.

public static final int
ZSTD_c_maxBlockSize

Allowed values are between 1KB and BLOCKSIZE_MAX (128KB).

public static final int
ZSTD_c_prefetchCDictTables

Controlled with ZSTD_paramSwitch_e enum.

public static final int
ZSTD_c_rsyncable

Enables rsyncable mode, which makes compressed files more rsync friendly by adding periodic synchronization points to the compressed data.

public static final int
ZSTD_c_searchForExternalRepcodes

This parameter affects how zstd parses external sequences, such as sequences provided through the compressSequences API or from an external block-level sequence producer.

public static final int
ZSTD_c_srcSizeHint

User's best guess of source size.

public static final int
ZSTD_c_stableInBuffer

Experimental parameter.

public static final int
ZSTD_c_stableOutBuffer

Experimental parameter.

public static final int
ZSTD_c_targetCBlockSize

Tries to fit compressed block size to be around targetCBlockSize.

public static final int
ZSTD_c_useBlockSplitter

Controlled with ZSTD_paramSwitch_e enum.

public static final int
ZSTD_c_useRowMatchFinder

Controlled with ZSTD_paramSwitch_e enum.

public static final int
ZSTD_c_validateSequences

Default is 0 == disabled.

public static final int
public static final int
public static final int
public static final int
public static final int
ZSTD_d_disableHuffmanAssembly

Set to 1 to disable the Huffman assembly implementation.

public static final int
ZSTD_d_forceIgnoreChecksum

Experimental parameter.

public static final int
ZSTD_d_format

Experimental parameter.

public static final int
public static final int
ZSTD_d_refMultipleDDicts

Experimental parameter.

public static final int
ZSTD_d_stableOutBuffer

Experimental parameter.

public static final int
public static final int
ZSTD_dct_auto

ZSTD_dictContentType_e Enum values:

  • dct_auto - dictionary is "full" when starting with MAGIC_DICTIONARY, otherwise it is "rawContent"
  • dct_rawContent - ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY
  • dct_fullDict - refuses to load a dictionary if it does not respect Zstandard's specification, starting with ZSTD_MAGIC_DICTIONARY
public static final int
ZSTD_dct_fullDict

ZSTD_dictContentType_e Enum values:

  • dct_auto - dictionary is "full" when starting with MAGIC_DICTIONARY, otherwise it is "rawContent"
  • dct_rawContent - ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY
  • dct_fullDict - refuses to load a dictionary if it does not respect Zstandard's specification, starting with ZSTD_MAGIC_DICTIONARY
public static final int
ZSTD_dct_rawContent

ZSTD_dictContentType_e Enum values:

  • dct_auto - dictionary is "full" when starting with MAGIC_DICTIONARY, otherwise it is "rawContent"
  • dct_rawContent - ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY
  • dct_fullDict - refuses to load a dictionary if it does not respect Zstandard's specification, starting with ZSTD_MAGIC_DICTIONARY
public static final int
ZSTD_dictDefaultAttach

ZSTD_dictAttachPref_e Enum values:

public static final int
ZSTD_dictForceAttach

ZSTD_dictAttachPref_e Enum values:

public static final int
ZSTD_dictForceCopy

ZSTD_dictAttachPref_e Enum values:

public static final int
ZSTD_dictForceLoad

ZSTD_dictAttachPref_e Enum values:

public static final int
ZSTD_dlm_byCopy

ZSTD_dictLoadMethod_e Enum values:

  • dlm_byCopy - Copy dictionary content internally
  • dlm_byRef - Reference dictionary content -- the dictionary buffer must outlive its users.
public static final int
ZSTD_dlm_byRef

ZSTD_dictLoadMethod_e Enum values:

  • dlm_byCopy - Copy dictionary content internally
  • dlm_byRef - Reference dictionary content -- the dictionary buffer must outlive its users.
public static final int
ZSTD_f_zstd1

ZSTD_format_e Enum values:

  • f_zstd1 - zstd frame format, specified in zstd_compression_format.md (default)
  • f_zstd1_magicless - Variant of zstd frame format, without initial 4-bytes magic number. Useful to save 4 bytes per generated frame. Decoder cannot recognise automatically this format, requiring this instruction.
public static final int
ZSTD_f_zstd1_magicless

ZSTD_format_e Enum values:

  • f_zstd1 - zstd frame format, specified in zstd_compression_format.md (default)
  • f_zstd1_magicless - Variant of zstd frame format, without initial 4-bytes magic number. Useful to save 4 bytes per generated frame. Decoder cannot recognise automatically this format, requiring this instruction.
public static final int
ZSTD_frame

ZSTD_frameType_e Enum values:

public static final int
public static final int
public static final int
public static final int
ZSTD_lcm_auto

ZSTD_literalCompressionMode_e Enum values:

  • lcm_auto - Automatically determine the compression mode based on the compression level.

    Negative compression levels will be uncompressed, and positive compression levels will be compressed.

  • lcm_huffman - Always attempt Huffman compression. Uncompressed literals will still be emitted if Huffman compression is not profitable.
  • lcm_uncompressed - Always emit uncompressed literals.
public static final int
ZSTD_lcm_huffman

ZSTD_literalCompressionMode_e Enum values:

  • lcm_auto - Automatically determine the compression mode based on the compression level.

    Negative compression levels will be uncompressed, and positive compression levels will be compressed.

  • lcm_huffman - Always attempt Huffman compression. Uncompressed literals will still be emitted if Huffman compression is not profitable.
  • lcm_uncompressed - Always emit uncompressed literals.
public static final int
ZSTD_lcm_uncompressed

ZSTD_literalCompressionMode_e Enum values:

  • lcm_auto - Automatically determine the compression mode based on the compression level.

    Negative compression levels will be uncompressed, and positive compression levels will be compressed.

  • lcm_huffman - Always attempt Huffman compression. Uncompressed literals will still be emitted if Huffman compression is not profitable.
  • lcm_uncompressed - Always emit uncompressed literals.
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
ZSTD_ps_auto

ZSTD_paramSwitch_e

This enum controls features which are conditionally beneficial.

public static final int
ZSTD_ps_disable

ZSTD_paramSwitch_e

This enum controls features which are conditionally beneficial.

public static final int
ZSTD_ps_enable

ZSTD_paramSwitch_e

This enum controls features which are conditionally beneficial.

public static final int
public static final int
public static final int
public static final long
public static final int
ZSTD_sf_explicitBlockDelimiters

ZSTD_sequenceFormat_e Enum values:

public static final int
ZSTD_sf_noBlockDelimiters

ZSTD_sequenceFormat_e Enum values:

public static final int
ZSTD_skippableFrame

ZSTD_frameType_e Enum values:

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native void
nZSTD_adjustCParams(long cPar, long srcSize, long dictSize, long __result)

Unsafe version of: adjustCParams

public static native long
nZSTD_CCtx_getParameter(long cctx, int param, long value)

Unsafe version of: CCtx_getParameter

public static native long
nZSTD_CCtx_loadDictionary_advanced(long cctx, long dict, long dictSize, int dictLoadMethod, int dictContentType)

Unsafe version of: CCtx_loadDictionary_advanced

public static native long
nZSTD_CCtx_loadDictionary_byReference(long cctx, long dict, long dictSize)

Unsafe version of: CCtx_loadDictionary_byReference

public static native long
nZSTD_CCtx_refPrefix_advanced(long cctx, long prefix, long prefixSize, int dictContentType)

Unsafe version of: CCtx_refPrefix_advanced

public static native long
nZSTD_CCtx_refThreadPool(long cctx, long pool)

Unsafe version of: CCtx_refThreadPool

public static native long
nZSTD_CCtx_setCParams(long cctx, long cparams)

Unsafe version of: CCtx_setCParams

public static native long
nZSTD_CCtx_setFParams(long cctx, long fparams)

Unsafe version of: CCtx_setFParams

public static native long
public static native long
nZSTD_CCtx_setParams(long cctx, long params)

Unsafe version of: CCtx_setParams

public static native long
nZSTD_CCtxParams_getParameter(long params, int param, long value)

Unsafe version of: CCtxParams_getParameter

public static native long
nZSTD_CCtxParams_init(long cctxParams, int compressionLevel)

Unsafe version of: CCtxParams_init

public static native long
nZSTD_CCtxParams_init_advanced(long cctxParams, long params)

Unsafe version of: CCtxParams_init_advanced

public static native long
nZSTD_CCtxParams_reset(long params)

Unsafe version of: CCtxParams_reset

public static native long
nZSTD_CCtxParams_setParameter(long params, int param, int value)

Unsafe version of: CCtxParams_setParameter

public static native long
nZSTD_checkCParams(long params)

Unsafe version of: checkCParams

public static native long
nZSTD_compressSequences(long cctx, long dst, long dstSize, long inSeqs, long inSeqsSize, long src, long srcSize)

Unsafe version of: compressSequences

public static native long
nZSTD_compressStream2_simpleArgs(long cctx, long dst, long dstCapacity, long dstPos, long src, long srcSize, long srcPos, int endOp)

Unsafe version of: compressStream2_simpleArgs

public static native long
nZSTD_createCCtx_advanced(long customMem)

public static native long
nZSTD_createCDict_advanced(long dict, long dictSize, int dictLoadMethod, int dictContentType, long cParams, long customMem)

Unsafe version of: createCDict_advanced

public static native long
nZSTD_createCDict_advanced2(long dict, long dictSize, int dictLoadMethod, int dictContentType, long cctxParams, long customMem)

Unsafe version of: createCDict_advanced2

public static native long
nZSTD_createCDict_byReference(long dictBuffer, long dictSize, int compressionLevel)

Unsafe version of: createCDict_byReference

public static native long
public static native long
nZSTD_createDCtx_advanced(long customMem)

public static native long
nZSTD_createDDict_advanced(long dict, long dictSize, int dictLoadMethod, int dictContentType, long customMem)

Unsafe version of: createDDict_advanced

public static native long
nZSTD_createDDict_byReference(long dictBuffer, long dictSize)

Unsafe version of: createDDict_byReference

public static native long
public static native long
nZSTD_DCtx_getParameter(long dctx, int param, long value)

Unsafe version of: DCtx_getParameter

public static native long
nZSTD_DCtx_loadDictionary_advanced(long dctx, long dict, long dictSize, int dictLoadMethod, int dictContentType)

Unsafe version of: DCtx_loadDictionary_advanced

public static native long
nZSTD_DCtx_loadDictionary_byReference(long dctx, long dict, long dictSize)

Unsafe version of: DCtx_loadDictionary_byReference

public static native long
nZSTD_DCtx_refPrefix_advanced(long dctx, long prefix, long prefixSize, int dictContentType)

Unsafe version of: DCtx_refPrefix_advanced

public static native long
nZSTD_DCtx_setMaxWindowSize(long dctx, long maxWindowSize)

Unsafe version of: DCtx_setMaxWindowSize

public static native long
public static native long
nZSTD_decompressBegin_usingDDict(long dctx, long ddict)

public static native long
nZSTD_decompressBegin_usingDict(long dctx, long dict, long dictSize)

public static native long
nZSTD_decompressBound(long src, long
must be the exact size of this series (i.e. there should be a frame boundary at src + srcSize)
srcSize
)

Unsafe version of: decompressBound

public static native long
nZSTD_decompressContinue(long dctx, long dst, long dstCapacity, long src, long srcSize)

public static native long
nZSTD_decompressionMargin(long src, long
the size of the compressed frame(s)
srcSize
)

Unsafe version of: decompressionMargin

public static native long
nZSTD_decompressStream_simpleArgs(long dctx, long dst, long dstCapacity, long dstPos, long src, long srcSize, long srcPos)

Unsafe version of: decompressStream_simpleArgs

public static native long
public static native long
public static native long
nZSTD_estimateCDictSize_advanced(long dictSize, long cParams, int dictLoadMethod)

Unsafe version of: estimateCDictSize_advanced

public static native long
public static native long
public static native long
nZSTD_estimateDStreamSize_fromFrame(long src, long srcSize)

public static native long
nZSTD_findDecompressedSize(long src, long
must be the exact size of this series (i.e. there should be a frame boundary exactly at srcSize bytes after src + srcSize)
srcSize
)

Unsafe version of: findDecompressedSize

public static native long
nZSTD_frameHeaderSize(long src, long srcSize)

Unsafe version of: frameHeaderSize

public static native long
nZSTD_generateSequences(long zc, long outSeqs, long outSeqsSize, long src, long srcSize)

Unsafe version of: generateSequences

public static native void
nZSTD_getCParams(int compressionLevel, long estimatedSrcSize, long dictSize, long __result)

Unsafe version of: getCParams

public static native long
nZSTD_getFrameHeader(long zfhPtr, long src, long srcSize)

Unsafe version of: getFrameHeader

public static native long
nZSTD_getFrameHeader_advanced(long zfhPtr, long src, long srcSize, int format)

Unsafe version of: getFrameHeader_advanced

public static native void
nZSTD_getFrameProgression(long cctx, long __result)

Unsafe version of: getFrameProgression

public static native void
nZSTD_getParams(int compressionLevel, long estimatedSrcSize, long dictSize, long __result)

Unsafe version of: getParams

public static native long
nZSTD_initStaticCCtx(long workspace, long workspaceSize)

public static native long
nZSTD_initStaticCDict(long workspace, long workspaceSize, long dict, long dictSize, int dictLoadMethod, int dictContentType, long cParams)

Unsafe version of: initStaticCDict

public static native long
nZSTD_initStaticCStream(long workspace, long workspaceSize)

public static native long
nZSTD_initStaticDCtx(long workspace, long workspaceSize)

public static native long
nZSTD_initStaticDDict(long workspace, long workspaceSize, long dict, long dictSize, int dictLoadMethod, int dictContentType)

Unsafe version of: initStaticDDict

public static native long
nZSTD_initStaticDStream(long workspace, long workspaceSize)

public static native int
nZSTD_isFrame(long buffer, long size)

Unsafe version of: isFrame

public static native int
nZSTD_isSkippableFrame(long buffer, long size)

Unsafe version of: isSkippableFrame

public static native long
nZSTD_mergeBlockDelimiters(long sequences, long seqsSize)

Unsafe version of: mergeBlockDelimiters

public static native int
public static native long
public static native long
nZSTD_readSkippableFrame(long dst, long dstCapacity, long magicVariant, long src, long srcSize)

Unsafe version of: readSkippableFrame

public static native void
nZSTD_registerSequenceProducer(long cctx, long sequenceProducerState, long sequenceProducer)

Unsafe version of: registerSequenceProducer

public static native long
nZSTD_toFlushNow(long cctx)

Unsafe version of: toFlushNow

public static native long
nZSTD_writeSkippableFrame(long dst, long dstCapacity, long src, long srcSize, int magicVariant)

Unsafe version of: writeSkippableFrame

public static ZSTDCompressionParameters
ZSTD_adjustCParams(ZSTDCompressionParameters cPar, long srcSize, long dictSize, ZSTDCompressionParameters __result)

Optimizes params for a given srcSize and dictSize.

public static long
public static long
ZSTD_CCtx_loadDictionary_advanced(long cctx, ByteBuffer dict, int dictLoadMethod, int dictContentType)

Same as CCtx_loadDictionary, but gives finer control over how to load the dictionary (by copy ?

public static long
ZSTD_CCtx_loadDictionary_byReference(long cctx, ByteBuffer dict)

Same as CCtx_loadDictionary, but dictionary content is referenced, instead of being copied into CCtx.

public static long
ZSTD_CCtx_refPrefix_advanced(long cctx, ByteBuffer prefix, int dictContentType)

Same as CCtx_refPrefix, but gives finer control over how to interpret prefix content (automatic ?

public static long
ZSTD_CCtx_refThreadPool(long cctx, long pool)

Assigns a thread pool to a context (use NULL argument value to use an internal thread pool).

public static long

Returns:

0 on success, or an error code (can be checked with isError). On failure, no parameters are updated.
ZSTD_CCtx_setCParams
(long cctx, ZSTDCompressionParameters cparams)

Set all parameters provided within cparams into the working cctx.

public static long
ZSTD_CCtx_setFParams(long cctx, ZSTDFrameParameters fparams)

Set all parameters provided within fparams into the working cctx.

public static long
ZSTD_CCtx_setParametersUsingCCtxParams(long cctx, long params)

Applies a set of ZSTD_CCtx_params to the compression context.

public static long
ZSTD_CCtx_setParams(long cctx, ZSTDParameters params)

Set all parameters provided within params into the working cctx.

public static long
public static long
ZSTD_CCtxParams_init(long cctxParams, int compressionLevel)

Initializes the compression parameters of cctxParams according to compression level.

public static long
ZSTD_CCtxParams_init_advanced(long cctxParams, ZSTDParameters params)

Initializes the compression and frame parameters of cctxParams according to params.

public static long
ZSTD_CCtxParams_reset(long params)

Resets params to default values.

public static long
public static long

Returns:

0 on success, or an error code (can be checked with isError)
ZSTD_checkCParams
(ZSTDCompressionParameters params)

Ensures param values remain within authorized range.

public static long

Returns:

final compressed size, or a ZSTD error code.
ZSTD_compressSequences
(long cctx, ByteBuffer dst, ZSTDSequence.Buffer inSeqs, ByteBuffer src)

Compress an array of ZSTD_Sequence, associated with src buffer, into dst.

public static long
ZSTD_compressStream2_simpleArgs(long cctx, ByteBuffer dst, PointerBuffer dstPos, ByteBuffer src, PointerBuffer srcPos, int endOp)

Same as compressStream2, but using only integral types as arguments.

public static long
public static native long
ZSTD_createCCtxParams()

Creates a ZSTD_CCtx_params structure.

public static long
ZSTD_createCDict_advanced(ByteBuffer dict, int dictLoadMethod, int dictContentType, ZSTDCompressionParameters cParams, ZSTDCustomMem customMem)

public static long
ZSTD_createCDict_advanced2(ByteBuffer dict, int dictLoadMethod, int dictContentType, long cctxParams, ZSTDCustomMem customMem)

public static long
ZSTD_createCDict_byReference(ByteBuffer dictBuffer, int compressionLevel)

Creates a digested dictionary for compression Dictionary content is just referenced, not duplicated.

public static long
public static long
public static long
ZSTD_createDDict_advanced(ByteBuffer dict, int dictLoadMethod, int dictContentType, ZSTDCustomMem customMem)

public static long
ZSTD_createDDict_byReference(ByteBuffer dictBuffer)

Creates a digested dictionary, ready to start decompression operation without startup delay.

public static long
public static native long
ZSTD_createThreadPool(long numThreads)

Creates a new thread pool with a given number of threads.

public static long

Returns:

0, or an error code (which can be tested with isError)
ZSTD_DCtx_getParameter
(long dctx, int param, IntBuffer value)

Gets the requested decompression parameter value, selected by enum ZSTD_dParameter, and store it into int* value.

public static long
ZSTD_DCtx_loadDictionary_advanced(long dctx, ByteBuffer dict, int dictLoadMethod, int dictContentType)

Same as DCtx_loadDictionary, but gives direct control over how to load the dictionary (by copy ?

public static long
ZSTD_DCtx_loadDictionary_byReference(long dctx, ByteBuffer dict)

Same as DCtx_loadDictionary, but references dict content instead of copying it into dctx.

public static long
ZSTD_DCtx_refPrefix_advanced(long dctx, ByteBuffer prefix, int dictContentType)

Same as DCtx_refPrefix, but gives finer control over how to interpret prefix content (automatic ?

public static long

Returns:

0, or an error code (which can be tested using isError)
ZSTD_DCtx_setMaxWindowSize
(long dctx, long maxWindowSize)

Refuses allocating internal buffers for frames requiring a window size larger than provided limit.

public static native long
ZSTD_decodingBufferSize_min(long windowSize, long frameContentSize)

public static long
public static long
ZSTD_decompressBegin_usingDDict(long dctx, long ddict)

public static long
public static long

Returns:

upper-bound for the decompressed size of all data in all successive frames, or CONTENTSIZE_ERROR if an error occurred
ZSTD_decompressBound
(ByteBuffer
should point to the start of a series of ZSTD encoded and/or skippable frames
src
)

Note 1: an error can occur if src contains an invalid or incorrectly formatted frame.

public static long
public static long
ZSTD_DECOMPRESSION_MARGIN(long
the original uncompressed size of the data
originalSize
,
long
the block size == MIN(windowSize, ZSTD_BLOCKSIZE_MAX). Unless you explicitly set the windowLog smaller than ZSTD_BLOCKSIZELOG_MAX you can just use ZSTD_BLOCKSIZE_MAX.
blockSize
)

Similar to decompressionMargin, but instead of computing the margin from the compressed frame, compute it from the original size and the blockSizeLog.

public static long

Returns:

the decompression margin or an error that can be checked with isError.
ZSTD_decompressionMargin
(ByteBuffer
the compressed frame(s)
src
)

Zstd supports in-place decompression, where the input and output buffers overlap.

public static long
ZSTD_decompressStream_simpleArgs(long dctx, ByteBuffer dst, PointerBuffer dstPos, ByteBuffer src, PointerBuffer srcPos)

Same as decompressStream, but using only integral types as arguments.

public static native long
ZSTD_estimateCCtxSize(int compressionLevel)

Estimages memory usage of a future CCtx, before its creation.

public static long
public static long
public static native long
ZSTD_estimateCDictSize(long dictSize, int compressionLevel)

public static long
ZSTD_estimateCDictSize_advanced(long dictSize, ZSTDCompressionParameters cParams, int dictLoadMethod)

public static native long
ZSTD_estimateCStreamSize(int compressionLevel)

Provides a budget large enough for any compression level up to selected one.

public static long
public static long
public static native long
public static native long
ZSTD_estimateDDictSize(long dictSize, int dictLoadMethod)

public static native long
ZSTD_estimateDStreamSize(long windowSize)

public static long
public static long

Returns:

ZSTD_findDecompressedSize
(ByteBuffer
should point to the start of a series of ZSTD encoded and/or skippable frames
src
)

Note 1: decompressed size is an optional field, that may not be present, especially in streaming mode.

public static long

Returns:

: size of the Frame Header, or an error code (if srcSize is too small)
ZSTD_frameHeaderSize
(ByteBuffer src)

public static int
public static int
public static native long
ZSTD_freeCCtxParams(long
accepts NULL pointer
params
)

public static native void
ZSTD_freeThreadPool(long
accepts NULL pointer
pool
)

Frees a thread pool.

public static long

Returns:

number of sequences generated
ZSTD_generateSequences
(long zc, ZSTDSequence.Buffer outSeqs, ByteBuffer src)

Generate sequences using compress2, given a source buffer.

public static ZSTDCompressionParameters
ZSTD_getCParams(int compressionLevel, long
optional, select 0 if not known
estimatedSrcSize
,
long dictSize, ZSTDCompressionParameters __result)

Returns ZSTD_compressionParameters structure for a selected compression level and estimated srcSize.

public static long

Returns:

0, zfhPtr is correctly filled, >0, srcSize is too small, value is wanted srcSize amount, or an error code, which can be tested using isError
ZSTD_getFrameHeader
(ZSTDFrameHeader zfhPtr, ByteBuffer src)

Decode Frame Header, or requires larger srcSize.

public static long
ZSTD_getFrameHeader_advanced(ZSTDFrameHeader zfhPtr, ByteBuffer src, int format)

Same as getFrameHeader, with added capability to select a format (like f_zstd1_magicless).

public static ZSTDFrameProgression
ZSTD_getFrameProgression(long cctx, ZSTDFrameProgression __result)

Tells how much data has been ingested (read from input) consumed (input actually compressed) and produced (output) for current frame.

public static ZSTDParameters
ZSTD_getParams(int compressionLevel, long
optional, select 0 if not known
estimatedSrcSize
,
long dictSize, ZSTDParameters __result)

Same as getCParams(), but returns a full ZSTD_parameters object instead of sub-component ZSTD_compressionParameters.

public static long
public static long
ZSTD_initStaticCDict(ByteBuffer workspace, ByteBuffer dict, int dictLoadMethod, int dictContentType, ZSTDCompressionParameters cParams)

public static long
public static long
public static long
ZSTD_initStaticDDict(ByteBuffer workspace, ByteBuffer dict, int dictLoadMethod, int dictContentType)

public static long
public static boolean
ZSTD_isFrame(ByteBuffer buffer)

Tells if the content of buffer starts with a valid Frame Identifier.

public static boolean
ZSTD_isSkippableFrame(ByteBuffer buffer)

Tells if the content of buffer starts with a valid Frame Identifier for a skippable frame.

public static long

Returns:

number of sequences left after merging
ZSTD_mergeBlockDelimiters
(ZSTDSequence.Buffer sequences)

Given an array of ZSTD_Sequence, remove all sequences that represent block delimiters/last literals by merging them into the literals of the next sequence.

public static int
ZSTD_nextInputType(long dctx)

public static long
public static long

Returns:

number of bytes written or a ZSTD error
ZSTD_readSkippableFrame
(ByteBuffer dst, IntBuffer magicVariant, ByteBuffer src)

Retrieves a zstd skippable frame containing data given by src, and writes it to dst buffer.

public static void
ZSTD_registerSequenceProducer(long cctx, long sequenceProducerState, ZSTDSequenceProducerI sequenceProducer)

Instruct zstd to use a block-level external sequence producer function.

public static native long

Returns:

upper-bound for the number of sequences that can be generated from a buffer of srcSize bytes
ZSTD_sequenceBound
(long
size of the input buffer
srcSize
)

public static long

Returns:

amount of data stored in oldest job and ready to be flushed immediately. If == 0, it means either:
  • there is no active job (could be checked with getFrameProgression), or
  • oldest job is still actively compressing data, but everything it has produced has also been flushed so far, therefore flush speed is limited by production speed of oldest job irrespective of the speed of concurrent (and newer) jobs.
ZSTD_toFlushNow
(long cctx)

Tells how many bytes are ready to be flushed immediately.

public static long

Returns:

number of bytes written or a ZSTD error
ZSTD_writeSkippableFrame
(ByteBuffer dst, ByteBuffer src, int magicVariant)

Generates a zstd skippable frame containing data given by src, and writes it to dst buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait