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



    View Source
    const HeaderSize = 9

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


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

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


        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.


            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

                type Settings struct {
                	Alg Kind
                	Lvl int

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

                  func (Settings) Compression

                  func (set Settings) Compression() int32

                  Source Files