Module type Codec.Compressor


module type Compressor = sig .. end
Common interface for compressing (i.e., deflating) data.

val compress : 'a IO.output -> unit IO.output
Wrap an output channel, compressing transparently data when writing to it.

Operations performed on the returned channel can raise, in addition to their usual exceptions, Codec.Compression_error.

val open_out : ?mode:File.open_out_flag list ->
?perm:File.permission -> string -> unit IO.output
Shorthand: directly open a compressed file to write to it. See 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.