package bytesrw
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=fd1ee852cf9d8c3b1800d4927c18453b18385b49354fb3ea71ae08f1ca640741c0594863c5db339432da55a9ee42e4fdbc8d6ef0afe29a375aac1ec6cee11c0b
doc/bytesrw.zlib/Bytesrw_zlib/Zlib/index.html
Module Bytesrw_zlib.Zlib
zlib
streams.
Decompress
val decompress_reads : ?leftover:bool -> unit -> Bytesrw.Bytes.Reader.filter
decompress_reads () r
filters the reads of r
by decompressing a zlib
stream. If leftover
is:
false
(default), the reader errors if there is leftover data after the end of thezlib
stream.true
the reader decompresses onezlib
stream. Once the reader returnsBytesrw.Bytes.Slice.eod
,r
is positioned exactly after the end of thezlib
stream and can be read again to perform other non-filtered reads.
val decompress_writes : unit -> Bytesrw.Bytes.Writer.filter
decompress_writes () w ~eod
filters writes on w
by decompressing a zlib
stream until Bytesrw.Bytes.Slice.eod
is written, if leftover data remains an error is raised. If eod
is false
the last Bytes.Slice.eod
is not written on w
and at this point w
can be used again to perform othe non-filtered writes.
Compress
val compress_reads : ?level:level -> unit -> Bytesrw.Bytes.Reader.filter
compress_reads ~level () r
filters the reads of r
by compressing them to a zlib
stream at level level
(defaults to default_compression
).
val compress_writes : ?level:level -> unit -> Bytesrw.Bytes.Writer.filter
compress_writes ~level () w ~eod
filters writes on w
by compressing them to a zlib
stream at level level
(defaults to default_compression
) until Bytesrw.Bytes.Slice.eod
is written. If eod
is false
, the latter is not written on w
and at that point w
can be used again to perform non-filtered writes.