ZSTD_createCDict method

Pointer<ZSTD_CDict> ZSTD_createCDict(
  1. Pointer<Void> dictBuffer,
  2. int dictSize,
  3. int compressionLevel
)

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

Implementation

ffi.Pointer<ZSTD_CDict> ZSTD_createCDict(
    ffi.Pointer<ffi.Void> dictBuffer,
    int dictSize,
    int compressionLevel,
    ) {
  return _ZSTD_createCDict(
    dictBuffer,
    dictSize,
    compressionLevel,
  );
}