Module Ezgzip.Z

zlib compression

type error =
| Truncated of string

Extracted size is greater than the allowed maximum size

| 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 ]) Stdlib.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 : Stdlib.Format.formatter -> error -> unit
val pp_zlib_error : Stdlib.Format.formatter -> [ `Zlib of error ] -> unit