package ozstd

  1. Overview
  2. Docs

Module Ozstd.DecompressorSource

Zstandard decompression module.

The module offers both one-shot and streaming APIs for decompressing data.

Sourcemodule Context : sig ... end

A reusable decompression context.

One-shot decompressing

Sourceval decompress_bigstring : ?context:Context.t -> ?dictionary:Dictionary.t -> Bstr.t -> Bstr.t

decompress_bigstring ?context ?dictionary bigstring

Decompresses bigstring and returns the uncompressed data as a new bigstring.

Sourceval decompress_string : ?context:Context.t -> ?dictionary:Bstr.t -> string -> string

decompress_string ?context ?dictionary string

Decompresses string and returns the uncompressed data as a new string.

Sourceval decompress_channel : ?dictionary:Dictionary.t -> ?size_limit:int -> in_channel -> out_channel -> unit

decompress_channel ic oc

Decompresses data from ic channel to oc channel.

Into buffer

Sourceval decompress_bigstring_into : ?context:Context.t -> ?dictionary:Dictionary.t -> Bstr.t -> Bstr.t -> int

compress_bigstring_into ?context ?dictionary src dst

Decompresses src bigstring into dst bigstring buffer.

  • returns

    A number of bytes written.

Sourceval decompress_string_into_bytes : ?context:Context.t -> ?dictionary:Dictionary.t -> string -> bytes -> int

compress_bigstring_into ?context ?dictionary src dst

Decompresses src string into dst bytes buffer.

  • returns

    A number of bytes written.

Incremental compressing

Sourcemodule Stream : sig ... end

The decompression stream module for incremental decompression.

Sourcemodule State : sig ... end

A decompression stream state for feeding bytes during streaming decompression.