package ezgzip

  1. Overview
  2. Docs
On This Page
  1. zlib compression
Legend:
Library
Module
Module type
Parameter
Class
Class type

zlib compression

type error =
  1. | Truncated of string
    (*

    Extracted size is greater than the allowed maximum size

    *)
  2. | Compression_error of string
    (*

    zlib error

    *)

Possible error cases

val compress : ?level:int -> ?header:bool -> string -> string

compress ?level ?header input will return a zlib-compressed representation of input.

val decompress : ?header:bool -> ?max_size:int -> string -> (string, [> `Zlib of error ]) result

decompress ?header ?max_size input will return a decompressed representation of input.

  • returns

    Error `Zlib Compression_error message if Zlib.Error was raised while inflating input.

  • returns

    Error `Zlib Truncated incomplete if input inflates to more than max_size bytes. incomplete contains less than max_size bytes of inflated content from input.

val pp_error : Format.formatter -> error -> unit
val pp_zlib_error : Format.formatter -> [ `Zlib of error ] -> unit
OCaml

Innovation. Community. Security.