Creates huffman only deflate blocks. Disables Lempel-Ziv match searching and only performs Huffman entropy encoding. Results in faster compression, much less memory requirements during compression but bigger compressed sizes.
container: ContainerWriterType: typepub fn Compressor(comptime container: Container, comptime WriterType: type) type {
return SimpleCompressor(.huffman, container, WriterType);
}pub fn compress(comptime container: Container, reader: anytype, writer: anytype) !voidcontainer: Containerpub fn compress(comptime container: Container, reader: anytype, writer: anytype) !void {
var c = try huffman.compressor(container, writer);
try c.compress(reader);
try c.finish();
}pub fn compressor(comptime container: Container, writer: anytype) !huffman.Compressor(container, @TypeOf(writer))container: Containerpub fn compressor(comptime container: Container, writer: anytype) !huffman.Compressor(container, @TypeOf(writer)) {
return try huffman.Compressor(container, @TypeOf(writer)).init(writer);
}pub const huffman = struct {
pub fn compress(comptime container: Container, reader: anytype, writer: anytype) !void {
var c = try huffman.compressor(container, writer);
try c.compress(reader);
try c.finish();
}
pub fn Compressor(comptime container: Container, comptime WriterType: type) type {
return SimpleCompressor(.huffman, container, WriterType);
}
pub fn compressor(comptime container: Container, writer: anytype) !huffman.Compressor(container, @TypeOf(writer)) {
return try huffman.Compressor(container, @TypeOf(writer)).init(writer);
}
}