ZSTD_DCtx_loadDictionary method

int ZSTD_DCtx_loadDictionary(
  1. Pointer<ZSTD_DCtx> dctx,
  2. Pointer<Void> dict,
  3. int dictSize
)

! 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.

Implementation

int ZSTD_DCtx_loadDictionary(
    ffi.Pointer<ZSTD_DCtx> dctx,
    ffi.Pointer<ffi.Void> dict,
    int dictSize,
    ) {
  return _ZSTD_DCtx_loadDictionary(
    dctx,
    dict,
    dictSize,
  );
}