Qu

zlib_decompress

Builtin index · File I/O

result = zlib_decompress(data, [as_str=false])

Input: data, as_str · Output: result

What it is

Inflates a zlib stream (RFC 1950 wrapper around RFC 1951 DEFLATE): data is a Str or a Vec of 0-255 byte values; as_str (named boolean, default false) asks for text instead of bytes. Errors clearly on a stream it cannot parse rather than returning partial output.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = zlib_decompress(data, [as_str=false])
data Str or VecInflates a zlib stream (RFC 1950 wrapper around RFC 1951 DEFLATE): data is a Str or a Vec of 0-255 byte values.
as_str boolean, optional (default false)as_str (named boolean, default false) asks for text instead of bytes.
result Vec, number, or Str
Returns a Vec of 0-255 numbers, or the decompressed text as a Str when as_str = true.

Examples

No documentation example calls this form yet. The File I/O chapter is where one belongs.

How it works

zlib_decompress(bytes) — the DEFLATE/zlib decoder matfile/ exposed here as a real script-callable builtin for the first time rather than staying an implementation detail only those two readers could reach. No compressor to pair with it yet — flagged as a follow-up, not silently implied to exist.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.