A port of the heatshrink embedded compression library to Go
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()
}
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)
}