mozlz4

package
v0.0.0-...-3e30898 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Overview

Example
package main

import (
	"fmt"
	"io"
	"os"

	"github.com/frioux/leatherman/pkg/mozlz4"
)

func main() {
	file, err := os.Open(os.Args[1])
	if err != nil {
		fmt.Fprintf(os.Stderr, "Couldn't open: %s\n", err)
		os.Exit(1)
	}

	r, err := mozlz4.NewReader(file)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Couldn't create reader: %s\n", err)
		os.Exit(1)
	}
	if _, err = io.Copy(os.Stdout, r); err != nil {
		fmt.Fprintf(os.Stderr, "Couldn't copy: %s\n", err)
		os.Exit(1)
	}
}
Output:

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongHeader = errors.New("no mozLz4 header")
	ErrWrongSize   = errors.New("header size incorrect")
)

Errors

Functions

func NewReader

func NewReader(r io.Reader) (io.Reader, error)

NewReader returns an io.Reader that decompresses the data from r.

Types

This section is empty.

Jump to

Keyboard shortcuts

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