xz

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 5 Imported by: 0

README

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)
	}
}

Documentation

Overview

Package xz decompresses data with C-lzma library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(src io.Reader) io.ReadCloser

NewReader creates a XZ decoder reader from the given source.

Types

This section is empty.

Directories

Path Synopsis
Package lzma decompresses data with C-lzma library.
Package lzma decompresses data with C-lzma library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL