Availability:
:- use_module(library(zlib)).(can be autoloaded)If an output stream is enabled, Options define the desired wrapper and compression level. Defined options on output streams are:
- format(+Format)
- Either
deflate(default) orgzip. Thedeflateenvelope is simple and short and is typically used for compressed (network) communication. Thegzipenvelope is compatible to the gzip program and intended to read/write compressed files. - level(+Level)
- Number between 0 and 9, specifying the compression level, Higher levels use more resources. Default is 6, generally believed to be a good compromise between speed, memory requirement and compression.
Generic options are:
- close_parent(Bool)
- If
true(default), closing the compressed stream also closes (and thus invalidates) the wrapped stream. Iffalse, the wrapped stream is not closed. This can be used to read/write a compressed ndata block as partial input/output on a stream.