module GZip: Libs.GZip
GZip - compression/decompression interface.
This module provide access to GZip compression and decompression
functionalities. Both the common (de)compression interface
(implemented by all compression libraries available via Batteries)
and GZip-specific functionalities are accessible using this
module.
Author(s): Stefano Zacchiroli
val uncompress : IO.input -> IO.input
Operations performed on the returned channel can raise, in
addition to their usual exceptions,
Codec.Compression_error
.
val open_in : ?mode:File.open_in_flag list ->
?perm:File.permission -> string -> IO.input
File.open_in
val with_in : IO.input -> (IO.input -> 'a) -> 'a
with_in input f
creates a new input input'
which will
transparently decompress data from input
, then invokes f
input'
to process that new input. Once f
has returned or
triggered an exception, the input'
is closed before
proceeding.val compress : 'a IO.output -> unit IO.output
Operations performed on the returned channel can raise, in
addition to their usual exceptions,
Codec.Compression_error
.
If you use this function, you will need to close the
channel manually, using IO.close_in
.
val open_out : ?mode:File.open_out_flag list ->
?perm:File.permission -> string -> unit IO.output
File.open_out
val with_out : unit IO.output -> (unit IO.output -> 'a) -> 'a
with_out output f
first creates a new output output'
which will
transparently compress data to output
and then invokes f output'
.
Once f output'
has returned or triggered an exception,
output'
is closed before proceeding.
Provide acces to GZip-specific features.
val gzip_compress : ?level:int -> 'a IO.output -> unit IO.output
GZip.compress
, but
enable to specifiy gzip-specific compression parametersInvalid_argument
if level is not included in the expected
rangelevel
: compression level (an integer between 1 and 9),
with 1 being the weakest (but fastest) compression and 9 being
the strongest (but slowest) compression. Default: 6.