View Source ExZstd.DCtx (ex_zstd v0.5.2)

Decompression context. To know more check out the ExZstd doc.

Summary

Functions

Identical to decompress!. Wraps the result in a maybe instead of raising.

Decompresses a chunk of data using the given context. If :content_size_unknown is returned stream decompression can be still attempted.

Identical to decompress_stream. Wraps the result in a maybe instead of raising.

Decompresses multiple frames with streaming.

Gets the value of a parameter of a decompression context (dparam). See ExZstd.Dparam for more information.

Loads a decompression dictionary inside the decompresson context.

Creates a decompression context

Resets the decompression context, interrupting any ongoing decompression and resetting the parameters to their default values.

Sets a parameter of a decompression context (dparam) to the given value. See ExZstd.Dparam for more information.

Types

@opaque t()

Functions

Link to this function

decompress(dctx, binary)

View Source
@spec decompress(t(), binary()) :: maybe(binary(), ExZstd.decompression_error())

Identical to decompress!. Wraps the result in a maybe instead of raising.

Note: this functions reads the header to find out the size of the decompressed data. Only feed it trusted input!

@spec decompress!(t(), binary()) :: binary()

Decompresses a chunk of data using the given context. If :content_size_unknown is returned stream decompression can be still attempted.

Note: this functions reads the header to find out the size of the decompressed data. Only feed it trusted input!

Link to this function

decompress_stream(dctx, data)

View Source
@spec decompress_stream(t(), binary()) ::
  {:ok, non_neg_integer(), binary()} | {:error, ExZstd.error()}

Identical to decompress_stream. Wraps the result in a maybe instead of raising.

Link to this function

decompress_stream!(dctx, data)

View Source
@spec decompress_stream!(t(), binary()) :: {non_neg_integer(), binary()}

Decompresses multiple frames with streaming.

Link to this function

get_dparam(dctx, dparam)

View Source
@spec get_dparam(t(), ExZstd.Dparam.t()) :: integer()

Gets the value of a parameter of a decompression context (dparam). See ExZstd.Dparam for more information.

Link to this function

load_dictionary(dctx, dictionary)

View Source
@spec load_dictionary(t(), binary()) :: t()

Loads a decompression dictionary inside the decompresson context.

@spec new() :: t()

Creates a decompression context

Link to this function

reset(cctx, reset_directive)

View Source
@spec reset(t(), ExZstd.reset_directive()) :: t()

Resets the decompression context, interrupting any ongoing decompression and resetting the parameters to their default values.

Link to this function

set_dparam(dctx, dparam, value)

View Source
@spec set_dparam(t(), pos_integer(), integer()) :: t()

Sets a parameter of a decompression context (dparam) to the given value. See ExZstd.Dparam for more information.