ZstandardAndroidBindings class

Bindings for src/zstandard_android.h.

Regenerate bindings with dart run ffigen --config ffigen.yaml.

Constructors

ZstandardAndroidBindings(DynamicLibrary dynamicLibrary)
The symbols are looked up in dynamicLibrary.
ZstandardAndroidBindings.fromLookup(Pointer<T> lookup<T extends NativeType>(String symbolName))
The symbols are looked up with lookup.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
ZSTD_CCtx_loadDictionary(Pointer<ZSTD_CCtx> cctx, Pointer<Void> dict, int dictSize) int
! ZSTD_CCtx_loadDictionary() : Requires v1.4.0+ Create an internal CDict from dict buffer. Decompression will have to use same dictionary. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary, meaning "return to no-dictionary mode". Note 1 : Dictionary is sticky, it will be used for all future compressed frames, until parameters are reset, a new dictionary is loaded, or the dictionary is explicitly invalidated by loading a NULL dictionary. Note 2 : Loading a dictionary involves building tables. It's also a CPU consuming operation, with non-negligible impact on latency. Tables are dependent on compression parameters, and for this reason, compression parameters can no longer be changed after loading a dictionary. Note 3 :dict content will be copied internally. Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead. In such a case, dictionary buffer must outlive its users. Note 4 : Use ZSTD_CCtx_loadDictionary_advanced() to precisely select how dictionary content must be interpreted. Note 5 : This method does not benefit from LDM (long distance mode). If you want to employ LDM on some large dictionary content, prefer employing ZSTD_CCtx_refPrefix() described below.
ZSTD_CCtx_refCDict(Pointer<ZSTD_CCtx> cctx, Pointer<ZSTD_CDict> cdict) int
! ZSTD_CCtx_refCDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used for all future compressed frames. Note that compression parameters are enforced from within CDict, and supersede any compression parameter previously set within CCtx. The parameters ignored are labelled as "superseded-by-cdict" in the ZSTD_cParameter enum docs. The ignored parameters will be used again if the CCtx is returned to no-dictionary mode. The dictionary will remain valid for future compressed frames using same CCtx. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special : Referencing a NULL CDict means "return to no-dictionary mode". Note 1 : Currently, only one dictionary can be managed. Referencing a new dictionary effectively "discards" any previous one. Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx.
ZSTD_CCtx_refPrefix(Pointer<ZSTD_CCtx> cctx, Pointer<Void> prefix, int prefixSize) int
! ZSTD_CCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) for next compressed frame. A prefix is only used once. Tables are discarded at end of frame (ZSTD_e_end). Decompression will need same prefix to properly regenerate data. Compressing with a prefix is similar in outcome as performing a diff and compressing it, but performs much faster, especially during decompression (compression speed is tunable with compression level). This method is compatible with LDM (long distance mode). @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary Note 1 : Prefix buffer is referenced. It must outlive compression. Its content must remain unmodified during compression. Note 2 : If the intention is to diff some large src data blob with some prior version of itself, ensure that the window size is large enough to contain the entire source. See ZSTD_c_windowLog. Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters. It's a CPU consuming operation, with non-negligible impact on latency. If there is a need to use the same prefix multiple times, consider loadDictionary instead. Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent). Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation.
ZSTD_CCtx_reset(Pointer<ZSTD_CCtx> cctx, int reset) int
! ZSTD_CCtx_reset() : There are 2 different things that can be reset, independently or jointly :
ZSTD_CCtx_setParameter(Pointer<ZSTD_CCtx> cctx, int param, int value) int
! ZSTD_CCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_cParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is generally only possible during frame initialization (before starting compression). Exception : when using multi-threading mode (nbWorkers >= 1), the following parameters can be updated during compression (within same frame): => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy. new parameters will be active for next job only (after a flush()). @return : an error code (which can be tested using ZSTD_isError()).
ZSTD_CCtx_setPledgedSrcSize(Pointer<ZSTD_CCtx> cctx, int pledgedSrcSize) int
! ZSTD_CCtx_setPledgedSrcSize() : Total input data size to be compressed as a single frame. Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag. This value will also be controlled at end of frame, and trigger an error if not respected. @result : 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame. In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN. ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame. Note 2 : pledgedSrcSize is only valid once, for the next frame. It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN. Note 3 : Whenever all input data is provided and consumed in a single round, for example with ZSTD_compress2(), or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end), this value is automatically overridden by srcSize instead.
ZSTD_compress(Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int srcSize, int compressionLevel) int
Simple API / /*! ZSTD_compress() : Compresses src content as a single zstd compressed frame into already allocated dst. NOTE: Providing dstCapacity >= ZSTD_compressBound(srcSize) guarantees that zstd will have enough space to successfully compress the data. @return : compressed size written into dst (<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).
ZSTD_compress2(Pointer<ZSTD_CCtx> cctx, Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int srcSize) int
! ZSTD_compress2() : Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API. (note that this entry point doesn't even expose a compression level parameter). ZSTD_compress2() always starts a new frame. Should cctx hold data from a previously unfinished frame, everything about it is forgotten.
ZSTD_compress_usingCDict(Pointer<ZSTD_CCtx> cctx, Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int srcSize, Pointer<ZSTD_CDict> cdict) int
! ZSTD_compress_usingCDict() : Compression using a digested Dictionary. Recommended when same dictionary is used multiple times. Note : compression level is decided at dictionary creation time, and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)
ZSTD_compress_usingDict(Pointer<ZSTD_CCtx> ctx, Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int srcSize, Pointer<Void> dict, int dictSize, int compressionLevel) int
Simple dictionary API / /*! ZSTD_compress_usingDict() : Compression at an explicit compression level using a Dictionary. A dictionary can be any arbitrary data segment (also called a prefix), or a buffer with specified information (see zdict.h). Note : This function loads the dictionary, resulting in significant startup delay. It's intended for a dictionary used only once. Note 2 : When dict == NULL || dictSize < 8 no dictionary is used.
ZSTD_compressBound(int srcSize) int
ZSTD_compressCCtx(Pointer<ZSTD_CCtx> cctx, Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int srcSize, int compressionLevel) int
! ZSTD_compressCCtx() : Same as ZSTD_compress(), using an explicit ZSTD_CCtx. Important : in order to mirror ZSTD_compress() behavior, this function compresses at the requested compression level, ignoring any other advanced parameter . If any advanced parameter was set using the advanced API, they will all be reset. Only compressionLevel remains.
ZSTD_compressStream(Pointer<ZSTD_CStream> zcs, Pointer<ZSTD_outBuffer> output, Pointer<ZSTD_inBuffer> input) int
! Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue). NOTE: The return value is different. ZSTD_compressStream() returns a hint for the next read size (if non-zero and not an error). ZSTD_compressStream2() returns the minimum nb of bytes left to flush (if non-zero and not an error).
ZSTD_compressStream2(Pointer<ZSTD_CCtx> cctx, Pointer<ZSTD_outBuffer> output, Pointer<ZSTD_inBuffer> input, int endOp) int
! ZSTD_compressStream2() : Requires v1.4.0+ Behaves about the same as ZSTD_compressStream, with additional control on end directive.
ZSTD_cParam_getBounds(int cParam) ZSTD_bounds
! ZSTD_cParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped. @return : a structure, ZSTD_bounds, which contains
ZSTD_createCCtx() Pointer<ZSTD_CCtx>
ZSTD_createCDict(Pointer<Void> dictBuffer, int dictSize, int compressionLevel) Pointer<ZSTD_CDict>
! ZSTD_createCDict() : When compressing multiple messages or blocks using the same dictionary, it's recommended to digest the dictionary only once, since it's a costly operation. ZSTD_createCDict() will create a state from digesting a dictionary. The resulting state can be used for future compression operations with very limited startup cost. ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict. Note 1 : Consider experimental function ZSTD_createCDict_byReference() if you prefer to not duplicate @dictBuffer content. Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer, in which case the only thing that it transports is the @compressionLevel. This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively, expecting a ZSTD_CDict parameter with any data, including those without a known dictionary.
ZSTD_createCStream() Pointer<ZSTD_CStream>
===== ZSTD_CStream management functions =====
ZSTD_createDCtx() Pointer<ZSTD_DCtx>
ZSTD_createDDict(Pointer<Void> dictBuffer, int dictSize) Pointer<ZSTD_DDict>
! ZSTD_createDDict() : Create a digested dictionary, ready to start decompression operation without startup delay. dictBuffer can be released after DDict creation, as its content is copied inside DDict.
ZSTD_createDStream() Pointer<ZSTD_DStream>
===== ZSTD_DStream management functions =====
ZSTD_CStreamInSize() int
These buffer sizes are softly recommended. They are not required : ZSTD_compressStream*() happily accepts any buffer size, for both input and output. Respecting the recommended size just makes it a bit easier for ZSTD_compressStream*(), reducing the amount of memory shuffling and buffering, resulting in minor performance savings.
ZSTD_CStreamOutSize() int
ZSTD_DCtx_loadDictionary(Pointer<ZSTD_DCtx> dctx, Pointer<Void> dict, int dictSize) int
! ZSTD_DCtx_loadDictionary() : Requires v1.4.0+ Create an internal DDict from dict buffer, to be used to decompress all future frames. The dictionary remains valid for all future frames, until explicitly invalidated, or a new dictionary is loaded. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, meaning "return to no-dictionary mode". Note 1 : Loading a dictionary involves building tables, which has a non-negligible impact on CPU usage and latency. It's recommended to "load once, use many times", to amortize the cost Note 2 :dict content will be copied internally, so dict can be released after loading. Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead. Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of how dictionary content is loaded and interpreted.
ZSTD_DCtx_refDDict(Pointer<ZSTD_DCtx> dctx, Pointer<ZSTD_DDict> ddict) int
! ZSTD_DCtx_refDDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used to decompress next frames. The dictionary remains active for decompression of future frames using same DCtx.
ZSTD_DCtx_refPrefix(Pointer<ZSTD_DCtx> dctx, Pointer<Void> prefix, int prefixSize) int
! ZSTD_DCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) to decompress next frame. This is the reverse operation of ZSTD_CCtx_refPrefix(), and must use the same prefix as the one used during compression. Prefix is only used once. Reference is discarded at end of frame. End of frame is reached when ZSTD_decompressStream() returns 0. @result : 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary Note 2 : Prefix buffer is referenced. It must outlive decompression. Prefix buffer must remain unmodified up to the end of frame, reached when ZSTD_decompressStream() returns 0. Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent). Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section) Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. A full dictionary is more costly, as it requires building tables.
ZSTD_DCtx_reset(Pointer<ZSTD_DCtx> dctx, int reset) int
! ZSTD_DCtx_reset() : Return a DCtx to clean state. Session and parameters can be reset jointly or separately. Parameters can only be reset when no active frame is being decompressed. @return : 0, or an error code, which can be tested with ZSTD_isError()
ZSTD_DCtx_setParameter(Pointer<ZSTD_DCtx> dctx, int param, int value) int
! ZSTD_DCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_dParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is only possible during frame initialization (before starting decompression). @return : 0, or an error code (which can be tested using ZSTD_isError()).
ZSTD_decompress(Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int compressedSize) int
! ZSTD_decompress() : compressedSize : must be the exact size of some number of compressed and/or skippable frames. Multiple compressed frames can be decompressed at once with this method. The result will be the concatenation of all decompressed frames, back to back. dstCapacity is an upper bound of originalSize to regenerate. First frame's decompressed size can be extracted using ZSTD_getFrameContentSize(). If maximum upper bound isn't known, prefer using streaming mode to decompress data. @return : the number of bytes decompressed into dst (<= dstCapacity), or an errorCode if it fails (which can be tested using ZSTD_isError()).
ZSTD_decompress_usingDDict(Pointer<ZSTD_DCtx> dctx, Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int srcSize, Pointer<ZSTD_DDict> ddict) int
! ZSTD_decompress_usingDDict() : Decompression using a digested Dictionary. Recommended when same dictionary is used multiple times.
ZSTD_decompress_usingDict(Pointer<ZSTD_DCtx> dctx, Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int srcSize, Pointer<Void> dict, int dictSize) int
! ZSTD_decompress_usingDict() : Decompression using a known Dictionary. Dictionary must be identical to the one used during compression. Note : This function loads the dictionary, resulting in significant startup delay. It's intended for a dictionary used only once. Note : When dict == NULL || dictSize < 8 no dictionary is used.
ZSTD_decompressDCtx(Pointer<ZSTD_DCtx> dctx, Pointer<Void> dst, int dstCapacity, Pointer<Void> src, int srcSize) int
! ZSTD_decompressDCtx() : Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx. Compatible with sticky parameters (see below).
ZSTD_decompressStream(Pointer<ZSTD_DStream> zds, Pointer<ZSTD_outBuffer> output, Pointer<ZSTD_inBuffer> input) int
! ZSTD_decompressStream() : Streaming decompression function. Call repetitively to consume full input updating it as necessary. Function will update both input and output pos fields exposing current state via these fields:
ZSTD_defaultCLevel() int
ZSTD_dParam_getBounds(int dParam) ZSTD_bounds
! ZSTD_dParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped. @return : a structure, ZSTD_bounds, which contains
ZSTD_DStreamInSize() int
ZSTD_DStreamOutSize() int
ZSTD_endStream(Pointer<ZSTD_CStream> zcs, Pointer<ZSTD_outBuffer> output) int
! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).
ZSTD_findFrameCompressedSize(Pointer<Void> src, int srcSize) int
! ZSTD_findFrameCompressedSize() : Requires v1.4.0+ src should point to the start of a ZSTD frame or skippable frame. srcSize must be >= first frame size @return : the compressed size of the first frame starting at src, suitable to pass as srcSize to ZSTD_decompress or similar, or an error code if input is invalid
ZSTD_flushStream(Pointer<ZSTD_CStream> zcs, Pointer<ZSTD_outBuffer> output) int
! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).
ZSTD_freeCCtx(Pointer<ZSTD_CCtx> cctx) int
ZSTD_freeCDict(Pointer<ZSTD_CDict> CDict) int
! ZSTD_freeCDict() : Function frees memory allocated by ZSTD_createCDict(). If a NULL pointer is passed, no operation is performed.
ZSTD_freeCStream(Pointer<ZSTD_CStream> zcs) int
ZSTD_freeDCtx(Pointer<ZSTD_DCtx> dctx) int
ZSTD_freeDDict(Pointer<ZSTD_DDict> ddict) int
! ZSTD_freeDDict() : Function frees memory allocated with ZSTD_createDDict() If a NULL pointer is passed, no operation is performed.
ZSTD_freeDStream(Pointer<ZSTD_DStream> zds) int
ZSTD_getDecompressedSize(Pointer<Void> src, int srcSize) int
! ZSTD_getDecompressedSize() : NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize(). Both functions work the same way, but ZSTD_getDecompressedSize() blends "empty", "unknown" and "error" results to the same return value (0), while ZSTD_getFrameContentSize() gives them separate return values. @return : decompressed size of src frame content if known and not empty, 0 otherwise.
ZSTD_getDictID_fromCDict(Pointer<ZSTD_CDict> cdict) int
! ZSTD_getDictID_fromCDict() : Requires v1.5.0+ Provides the dictID of the dictionary loaded into cdict. If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. Non-conformant dictionaries can still be loaded, but as content-only dictionaries.
ZSTD_getDictID_fromDDict(Pointer<ZSTD_DDict> ddict) int
! ZSTD_getDictID_fromDDict() : Requires v1.4.0+ Provides the dictID of the dictionary loaded into ddict. If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. Non-conformant dictionaries can still be loaded, but as content-only dictionaries.
ZSTD_getDictID_fromDict(Pointer<Void> dict, int dictSize) int
! ZSTD_getDictID_fromDict() : Requires v1.4.0+ Provides the dictID stored within dictionary. if @return == 0, the dictionary is not conformant with Zstandard specification. It can still be loaded, but as a content-only dictionary.
ZSTD_getDictID_fromFrame(Pointer<Void> src, int srcSize) int
! ZSTD_getDictID_fromFrame() : Requires v1.4.0+ Provides the dictID required to decompressed the frame stored within src. If @return == 0, the dictID could not be decoded. This could for one of the following reasons :
ZSTD_getErrorName(int code) Pointer<Char>
ZSTD_getFrameContentSize(Pointer<Void> src, int srcSize) int
ZSTD_initCStream(Pointer<ZSTD_CStream> zcs, int compressionLevel) int
! Equivalent to:
ZSTD_initDStream(Pointer<ZSTD_DStream> zds) int
! ZSTD_initDStream() : Initialize/reset DStream state for new decompression operation. Call before new decompression operation using same DStream.
ZSTD_isError(int code) int
ZSTD_isError() : Most ZSTD_* functions returning a size_t value can be tested for error, using ZSTD_isError(). @return 1 if error, 0 otherwise
ZSTD_maxCLevel() int
ZSTD_minCLevel() int
ZSTD_sizeof_CCtx(Pointer<ZSTD_CCtx> cctx) int
! ZSTD_sizeof_*() : Requires v1.4.0+ These functions give the current memory usage of selected object. Note that object memory usage can evolve (increase or decrease) over time.
ZSTD_sizeof_CDict(Pointer<ZSTD_CDict> cdict) int
ZSTD_sizeof_CStream(Pointer<ZSTD_CStream> zcs) int
ZSTD_sizeof_DCtx(Pointer<ZSTD_DCtx> dctx) int
ZSTD_sizeof_DDict(Pointer<ZSTD_DDict> ddict) int
ZSTD_sizeof_DStream(Pointer<ZSTD_DStream> zds) int
ZSTD_versionNumber() int
! ZSTD_versionNumber() : Return runtime library version, the value is (MAJOR100100 + MINOR*100 + RELEASE).
ZSTD_versionString() Pointer<Char>
! ZSTD_versionString() : Return runtime library version, like "1.4.5". Requires v1.3.0+.

Operators

operator ==(Object other) bool
The equality operator.
inherited