Skip to content
FutureBlitz

    Install

    Import std.compress.deflate

    GzipCompressor

    std.compress.deflate

    class

    Public Class GzipCompressor Implements Coder

    Gzip's bytes made in turn, as DeflateCompressor makes Deflate's, each Finish ending a member.

    Examples

    Local compressor = GzipCompressor()
    Local gz = compressor.Add("first part, ".Bytes)
    gz.AddAll(compressor.Add("second part".Bytes))
    gz.AddAll(compressor.Finish())
    Expect(String.FromUtf8(Try Gzip.Decompress(gz)) == "first part, second part")

    std/compress/deflate.fb, line 205

    • @PanicsAtCaller Public New(level: Int = 6) constructor #

      A new GzipCompressor at the level. Panics when it isn't from 0 to 9.

    • Public Method Add(data: UInt8[]): UInt8[] method #

      Compresses data, and gives the Gzip bytes it has made so far, which can be none, as it holds some back to compress with what comes next.

    • Public Method Finish(): UInt8[] method #

      The rest of the bytes, which end the member, and starts again, for another.

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