package decompress

  1. Overview
  2. Docs
Implementation of Zlib and GZip in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

decompress-v1.4.2.tbz
sha256=822f125b46c87f4a902c334db8c86d4d5f33ebe978e93c40351a4d3269b95225
sha512=9cb82615923a5fffc5c8dce1d9361a467e35e91092c25c98f5afda8f4226059c59eb695c55e63adf92d766c7747e15df186386bcaeb399497dd1ae5b024c09fa

doc/decompress.lzo/Lzo/index.html

Module LzoSource

Sourcetype error = [
  1. | `Malformed of string
  2. | `Invalid_argument of string
  3. | `Invalid_dictionary
]
Sourceval pp_error : Format.formatter -> error -> unit
Sourceval uncompress : bigstring -> bigstring -> (bigstring, [> error ]) result

uncompress input output returns a sub-layout of output which is the inflated contents of input. Otherwise, it returns:

  • `Malformed if the input is not recognized as a LZO contents.
  • `Invalid_argument if output is not large enough to contain inflated contents.
  • `Invalid_dictionary if an op-code of input refers to an unbound location.
Sourceval uncompress_with_buffer : ?chunk:int -> bigstring -> (string, [> error ]) result

uncompress ?chunk input returns a fresh-allocated string which is the inflated contents of input. An internal Buffer.t is used and it can be initialized with chunk (default to 0x1000). Otherwise, it returns same errors as uncompress.

Sourcetype wrkmem

Type of an internal hash-table used by compress.

Sourceval make_wrkmem : unit -> wrkmem

make_wrkmem () returns a fresh-allocated wrkmem.

Sourceval compress : bigstring -> bigstring -> wrkmem -> int

compress input output wrkmem deflates input and produces a LZO contents into output. It uses wrkmem to do the deflation. It returns the number of bytes wrotes into output such as:

  let len = compress input output wrkmem in
  Bigarray.Array1.sub output 0 len

is the deflated contents of input.

  • raises Invalid_argument

    if output is not large enough to contain the deflated contents.

OCaml

Innovation. Community. Security.