Module Zstandard.Input
type t
Zstd exposes multiple API flavors which can be used to transform strings into strings. The
t
type encodes the various ways to pass a string from the OCaml world to ZStd functions.
val from_string : ?pos:int -> ?len:int -> string -> t
from_string ?pos ?len s
will pass the content ofs
to Zstd functions. This incurs a copy of the OCaml string whenfrom_string
is called.
val from_bytes : ?pos:int -> ?len:int -> Core_kernel.Bytes.t -> t
from_bytes ?pos ?len s
will pass the content ofs
to Zstd functions. This incurs an allocation of a buffer of sizelen
when callingfrom_bytes
, and a copy of the ocaml bytes each time the resultingt
is used by a compression / decompression function.
val from_bigstring : ?pos:int -> ?len:int -> Core_kernel.Bigstring.t -> t
from_bigstring ?pos ?len s
will pass the content ofs
betweenpos
andpos+len
to Zstd functions. This does not incur a copy.