flate

    MoonBit flate: provide simplified flate (LZW) compression algorithm.

    flate
    algorithm
    lzw
    moonbit
    Download zip
    Author
    Version
    0.36.13
    License
    Apache-2.0
    Last updated
    3 days ago
    Downloads
    36K

    Dependencies

    #gmlewis/flate

    check

    This is a simplified flate compression algorithm based on Go's implementation: https://cs.opensource.google/go/go/+/refs/tags/go1.23.1:src/compress/flate/deflatefast.go which has the copyright notice:

    // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.

    #Status

    The code has been updated to support compiler:

    $ moon version --all moon 0.1.20260827 (d0aaa07 2026-08-27) ~/.moon/bin/moon moonc v0.10.11+6ff76a5f9 (2026-08-28) ~/.moon/bin/moonc moonrun 0.1.20260827 (d0aaa07 2026-08-27) ~/.moon/bin/moonrun

    Reader

    pub(open) trait Reader {
    fn read(Self,
    Slice
    [Byte]) -> (Int,
    IOError
    ?)
    fn read_byte(Self) -> (Byte,
    IOError
    ?)
    }

    The actual read interface needed by [Decompressor::new].

    Decompressor

    type Decompressor

    Decompressor::make_reader

    fn Decompressor::make_reader(self : Decompressor, r : &Reader) -> Unit

    Decompressor::reset

    fn Decompressor::reset(self : Decompressor, r : &Reader, dict :
    Slice
    [Byte]) -> Unit

    DictWriter

    type DictWriter

    Writer

    type Writer

    impl Closer for Writer
    impl Writer for Writer

    Writer::new

    Writer::new returns a new [@io.WriteCloser] compressing data at the "BestSpeed" level. It writes its (compressed) data to the provided buf.

    Writer::new_dict

    fn Writer::new_dict(w : &
    Writer
    , dict :
    Slice
    [Byte]) -> Writer

    writer_closed_error

    let writer_closed_error :
    IOError

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io