Module Ezgzip
gzip compression
type error
=
Possible error cases
val compress : ?level:int -> string -> string
compress src
returns a gzip-compressed version ofsrc
.- parameter level
can use used to set the compression level from
0
(no compression) to9
(highest compression).
- raises Invalid_argument
if
level
is outside of the range 0 to 9.
val decompress : ?ignore_size:bool -> ?ignore_checksum:bool -> ?max_size:int -> string -> (string, [> `Gzip of error ]) Stdlib.result
decompress src
decompresses the content from the gzip-compressedsrc
.- parameter ignore_size
may be set to
true
if you want to ignore the expected decompressed size information in the gzip footer. Defaults tofalse
.
- parameter ignore_checksum
may be set to
true
if you want to ignore the expected decompressed data checksum in the gzip footer. Defaults tofalse
.
- parameter max_size
may be used to specify the maximum number of bytes to decompress. Defaults to
Sys.max_string_length
. Ifsrc
decompresses to more thanmax_size
bytes then this function will returnError (`Gzip (Truncated truncated_content))
containing the content which was decompressed.
- returns
Ok content
if the decompression was successful
- returns
Error err
if there was a problem during decompression
val pp_error : Stdlib.Format.formatter -> error -> unit
val pp_gzip_error : Stdlib.Format.formatter -> [ `Gzip of error ] -> unit
module Z : sig ... end