Decompresses srcBuf
into dstBuf
.
dstBuf
must be large enough to fit the entire result. srcBuf
must end
on a frame boundary (no partial frames or other trailing data).
Wraps ZSTD_decompressDCtx
.
Output buffer for decompressed bytes
Data to decompress
Number of decompressed bytes written to dstBuf
If the frame has the uncompressed size in the header, you can use getFrameContentSize to determine how big the buffer needs to be. If it's too large, or unknown, use decompressStream instead.
Decompresses srcBuf
into dstBuf
with a streaming interface.
May consume all or part of srcBuf
, and may partially write dstBuf
.
Returns a tuple with a bound on how many bytes are left to flush, how many
bytes were written, and how many bytes were consumed.
Wraps ZSTD_decompressStream
.
Output buffer for decompressed bytes
Data to decompress
Decompression progress information
This function requires some care to use correctly, consult the Zstandard manual for full usage information.
Decompresses srcBuf
into dstBuf
using the prepared dictionary dict
.
Works like decompress, except it uses the provided dictionary instead of any set on this context.
Wraps ZSTD_decompress_usingDDict
.
Output buffer for compressed bytes
Data to compress
Prepared dictionary
Number of compressed bytes written to dstBuf
Decompresses srcBuf
into dstBuf
, using dictBuf
as a dictionary.
Works like decompress, except it uses the provided dictionary instead of any set on this context.
Wraps ZSTD_decompress_usingDict
.
Output buffer for decompressed bytes
Data to decompress
Compression dictionary
Number of compressed bytes written to dstBuf
Loading the dictionary from a buffer is expensive. If the dictionary will be used more than once, it's better to load it into a DDict once and use decompressUsingDDict instead.
Load a compression dictionary from dictBuf
.
This dictionary will be used by decompress and decompressStream.
Wraps ZSTD_DCtx_loadDictionary
.
Resets this decompression context.
The reset
parameter controls what exactly is reset.
Wraps ZSTD_DCtx_reset
.
Set a decompression parameter.
Wraps ZSTD_DCtx_setParameter
.
Parameter to set
New parameter value
Decompression context.
Wraps
ZSTD_DCtx
(which is alsoZSTD_DStream
). The finalizer automatically callsZSTD_freeDCtx
when this object is garbage collected.