Skip to content
FutureBlitz

    Install

    Import std.compress.deflate

    Gzip

    std.compress.deflate

    struct

    Public Struct Gzip

    Gzip's bytes, of .gz files and HTTP's gzip: Deflate's, with a header and a CRC-32 checksum.

    Examples

    Local data = "the same words, the same words, the same words".Bytes
    Local gz = Gzip.Compress(data, 9)
    Expect(gz[0] == 0x1F && gz[1] == 0x8B)
    Local unpacked = Try Gzip.Decompress(gz)
    Expect(unpacked == data)

    std/compress/deflate.fb, line 127

    • @PanicsAtCaller Public Static Method Compress(data: UInt8[], level: Int = 6): UInt8[] static method #

      The data, compressed at the level, as one member. Panics when the level isn't from 0 to 9.

    • @PanicsAtCaller Public Static Method Decompress(data: UInt8[], limit: Int = MOST_BYTES): UInt8[] Throws IOError static method #

      The bytes the data is compressed from, each member's after the last's, or an IOError when it isn't Gzip's, ends early, or would come to more than limit bytes. Panics when the limit is negative.

    Report an issue with this page or with FutureBlitz on GitHub.