Skip to content

currantlabs/goheatshrink

Repository files navigation

goheatshrink

A port of the heatshrink embedded compression library to Go

Examples

Compressing

package main

import (
    "io"
	"os"

	"github.com/currantlabs/goheatshrink"
)

func main() {
    in, _ := os.Open("bigfile.bin")
    defer in.Close()

    out, _ := os.Create("bigfile.bin.hz")
    defer out.Close()

    w := goheatshrink.NewWriter(out)

    io.Copy(w, in)
    w.Close()
}

Decompressing

package main

import (
    "io"
	"os"

	"github.com/currantlabs/goheatshrink"
)

func main() {
    in, _ := os.Open("bigfile.bin.hz")
    defer in.Close()

    out, _ := os.Create("bigfile.bin")
    defer out.Close()

    r := goheatshrink.NewReader(in)

    io.Copy(out, r)
}

Build Status

Build Status

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages