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 ofinput
.
val decompress : ?header:bool -> ?max_size:int -> string -> (string, [> `Zlib of error ]) Stdlib.result
decompress ?header ?max_size input
will return a decompressed representation ofinput
.- returns
Error `Zlib Compression_error message
ifZlib
.Error was raised while inflatinginput
.
- returns
Error `Zlib Truncated incomplete
ifinput
inflates to more thanmax_size
bytes.incomplete
contains less thanmax_size
bytes of inflated content frominput
.