type error = De.Def.Ns.error
The type for deflation errors.
compress_bound len returns a clue about how many bytes we need to store the result of the deflation of
len bytes. It's a pessimistic calculation.
deflate ~level src dst deflates the content of
In case of success, it returns the bytes writen in an
Ok result. In case of failure, it returns the error in an
compress_bound can be used to determine how many bytes the user needs to allocate as the destination buffer when he wants to compress
Here is an example of how to compress any inputs:
val input : bigstring
let len = Zl.Def.Ns.compress_bound (De.bigstring_length input) in
let dst = De.bigstring_create len in
Zl.Def.Ns.deflate ~level:4 input dst