Esc

inflate_complete

procedureextensionsince 0.36.1Source
  • macOS: inflate_complete works on macOS
  • Linux: inflate_complete works on Linux
  • Windows: inflate_complete works on Windows
  • Wasm: inflate_complete works on Wasm

Decompresses a complete protocol payload, rejecting trailing bytes. Gzip members are concatenated in order and share one aggregate decompressed-output limit. Every checksum must pass before any output is returned; release success with free.

Signature

inflate_complete :: (
    data: [] u8,
    container := Deflate_Container.ZLIB,
    max_output: s64 = DEFAULT_MAX_OUTPUT
) -> (output: [] u8, ok: bool, error: string)
Example↗
packed := deflate(cast([] u8) "hello", .GZIP);
output, ok := inflate_complete(packed, .GZIP, 1024);
assert(ok && cast(string) output == "hello");
free(output.data);
free(packed.data);

See also