fn compressor(allocator: Allocator, writer: anytype, options: CompressorOptions) !Compressor(@TypeOf(writer))
Returns a new Compressor compressing data at the given level. Following zlib, levels range from 1 (best_speed) to 9 (best_compression); higher levels typically run slower but compress more. Level 0 (no_compression) does not attempt any compression; it only adds the necessary DEFLATE framing. Level -1 (default_compression) uses the default compression level. Level -2 (huffman_only) will use Huffman compression only, giving a very fast compression for all types of input, but sacrificing considerable compression efficiency.
dictionary
is optional and initializes the new Compressor
with a preset dictionary. The returned Compressor behaves as if the dictionary had been written to it without producing any compressed output. The compressed data written to hm_bw can only be decompressed by a Decompressor initialized with the same dictionary.
The compressed data will be passed to the provided writer
, see writer()
and write()
.