View Source ExZstd (ex_zstd v0.3.2)

Elixir bindings to the Zstandard library

Link to this section Summary

Functions

Initialize or re-initialize a Compression Stream using default compression level

Initialize or re-initialize a Compression Stream, using the compression level specified by level

Create a new Compression Stream

Reset a Compression Stream and start a new compression job, using same parameters from previous job

Reset a Compression Stream and start a new compression job with pledged source size, using same parameters from previous job

Initialize or re-initialize a Decompression Stream

Create a new Decompression Stream

Reset a Decompression Stream and start a new compression job, using same parameters from previous job

Compress a chunk of data with Simple API

Compress a chunk of data with Simple API, using specified compression level

Decompress a chunk of data with Simple API

Compress a chunk of data with Compression Stream

Decompress a chunk of data with Decompression Stream

Flush the Compression Stream, then close it

Link to this section Functions

@spec cstream_init(reference()) :: :ok | {:error, :einval | String.t()}

Initialize or re-initialize a Compression Stream using default compression level

Link to this function

cstream_init(zcs, level)

View Source
@spec cstream_init(reference(), integer()) :: :ok | {:error, :einval | String.t()}

Initialize or re-initialize a Compression Stream, using the compression level specified by level

@spec cstream_new() :: reference()

Create a new Compression Stream

@spec cstream_reset(reference()) :: :ok | {:error, :einval | String.t()}

Reset a Compression Stream and start a new compression job, using same parameters from previous job

Link to this function

cstream_reset(zcs, size)

View Source
@spec cstream_reset(reference(), non_neg_integer()) ::
  :ok | {:error, :einval | String.t()}

Reset a Compression Stream and start a new compression job with pledged source size, using same parameters from previous job

@spec dstream_init(reference()) :: :ok | {:error, :einval | String.t()}

Initialize or re-initialize a Decompression Stream

@spec dstream_new() :: reference()

Create a new Decompression Stream

@spec dstream_reset(reference()) :: :ok | {:error, :einval | String.t()}

Reset a Decompression Stream and start a new compression job, using same parameters from previous job

@spec init() :: :ok
@spec simple_compress(binary()) ::
  {:ok, binary()} | {:error, :einval | :enomem | String.t()}

Compress a chunk of data with Simple API

Link to this function

simple_compress(data, level)

View Source
@spec simple_compress(binary(), integer()) ::
  {:ok, binary()} | {:error, :einval | :enomem | String.t()}

Compress a chunk of data with Simple API, using specified compression level

@spec simple_decompress(binary()) ::
  {:ok, binary()} | {:error, :einval | :enomem | String.t()}

Decompress a chunk of data with Simple API

Link to this function

stream_compress(zcs, data)

View Source
@spec stream_compress(reference(), binary()) ::
  {:ok, binary()} | {:error, :einval | :enomem | String.t()}

Compress a chunk of data with Compression Stream

Link to this function

stream_decompress(zcs, data)

View Source
@spec stream_decompress(reference(), binary()) ::
  {:ok, binary()} | {:error, :einval | :enomem | String.t()}

Decompress a chunk of data with Decompression Stream

@spec stream_flush(reference()) ::
  {:ok, binary()} | {:error, :einval | :enomem | String.t()}

Flush the Compression Stream, then close it