hepgo-hep.org/x/hep/groot/internal/rcompress Index | Files

package rcompress

import "go-hep.org/x/hep/groot/internal/rcompress"

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

Index

Constants

const HeaderSize = 9

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

Variables

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

func (Kind) String

func (i Kind) String() string

type Settings

type Settings struct {
	Alg Kind
	Lvl int
}

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

func SettingsFrom

func SettingsFrom(compr int32) Settings

SettingsFrom create a Settings value from the provided compression configuration (compression algorithm and compression level), using ROOT's encoding.

func (Settings) Compression

func (set Settings) Compression() int32

Source Files

kind_string.go rcompress.go

Version
v0.36.0 (latest)
Published
Nov 15, 2024
Platform
linux/amd64
Imports
11 packages
Last checked
2 days ago

Tools for package owners.