rcompress

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

rcompress provides types and functions to compress and decompress ROOT data payloads.

Index

Constants

View Source
const HeaderSize = 9

Note: this contains ZL[src][dst] where src and dst are 3 bytes each.

Variables

View Source
var DefaultSettings = Settings{Alg: ZLIB, Lvl: flate.BestSpeed}

DefaultSettings is the default compression algorithm and level used in ROOT files and trees.

Functions

func Compress

func Compress(dst, src []byte, compr int32) ([]byte, error)

Compress compresses src, using the compression kind and level encoded into compr. Users can provide a non-nil dst to reduce allocation.

func Decompress

func Decompress(dst []byte, src io.Reader) error

Decompress decompresses src into dst.

Types

type Kind

type Kind int

Kind specifies the compression algorithm to be used during reading or writing ROOT files.

const (
	Inherit              Kind = -1
	UseGlobal            Kind = 0
	ZLIB                 Kind = +1
	LZMA                 Kind = +2
	OldCompression       Kind = +3
	LZ4                  Kind = +4
	ZSTD                 Kind = +5
	UndefinedCompression Kind = +6
)

constants for compression/decompression

type Settings added in v0.21.0

type Settings struct {
	Alg Kind
	Lvl int
}

Settings encodes the ROOT way of specifying a compression mechanism and its compression level.

func (Settings) Compression added in v0.21.0

func (set Settings) Compression() int32

Jump to

Keyboard shortcuts

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