Deflate module

inflate_into

procedureextensionsince 0.28.0Source

Like inflate, into a buffer the caller sized. Fails with "output is too small" when the stream expands past output; nothing is written beyond it.

Example↗
#import "Extensions/Deflate";

packed := deflate(cast([] u8) "abcabcabc");
buffer: [16] u8;
written, ok := inflate_into(packed, buffer);
assert(ok && written == 9);
inflate_into :: (
    data: [] u8,
    output: [] u8,
    container := Deflate_Container.ZLIB
) -> (written: s64, ok: bool, error: string)

Parameters

data: [] u8
output: [] u8
container := Deflate_Container.ZLIB

Returns

written: s64
ok: bool
error: string

See also