Function init [src]
input buffer is asserted to be at least 10 bytes, or EOF before then.
If buffer is provided then asserted to have flate.max_window_len
capacity.
Prototype
pub fn init(input: *Reader, container: Container, buffer: []u8) Decompress Parameters
input: *Readercontainer: Containerbuffer: []u8 Source
pub fn init(input: *Reader, container: Container, buffer: []u8) Decompress {
if (buffer.len != 0) assert(buffer.len >= flate.max_window_len);
return .{
.reader = .{
.vtable = if (buffer.len == 0) &direct_vtable else &indirect_vtable,
.buffer = buffer,
.seek = 0,
.end = 0,
},
.input = input,
.next_bits = 0,
.remaining_bits = 0,
.container_metadata = .init(container),
.lit_dec = .{},
.dst_dec = .{},
.final_block = false,
.state = .protocol_header,
.err = null,
};
}