Skip to content

Go package for .xz decompression with cgo bindings to liblzma

License

Notifications You must be signed in to change notification settings

dillon-giacoppo/xz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xz

The xz package implements reading of xz format compressed data implemented as a cgo shim over liblzma. It aims to reduce allocations and buffer copying to limit overhead where possible and remain performant.

Install

go get dill.foo/xz
liblzma Dependency

This module dynamically links to liblzma which must be installed on the system.

pkg-config is used to identify the compiler options but can be disabled with build tag nopkgconfig.

Ubuntu/Debian
sudo apt-get install liblzma-dev
MacOS
brew install xz

Example

package main

import (
	"fmt"
	"io"
	"os"

	"dill.foo/xz"
)

func main() {
	xr := xz.NewReader(os.Stdin)
	defer xr.Close()

	_, err := io.Copy(os.Stdout, xr)
	if err != nil {
		_, _ = fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}

About

Go package for .xz decompression with cgo bindings to liblzma

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages