lz4block

package
v0.0.0-...-8fa1e17 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package lz4block provides LZ4 BlockSize types and pools of buffers.

Index

Constants

View Source
const (
	Block64Kb uint32 = 1 << (16 + iota*2)
	Block256Kb
	Block1Mb
	Block4Mb
	Block8Mb = 2 * Block4Mb
)

Variables

View Source
var (
	BlockPool64K  = sync.Pool{New: func() interface{} { return make([]byte, Block64Kb) }}
	BlockPool256K = sync.Pool{New: func() interface{} { return make([]byte, Block256Kb) }}
	BlockPool1M   = sync.Pool{New: func() interface{} { return make([]byte, Block1Mb) }}
	BlockPool4M   = sync.Pool{New: func() interface{} { return make([]byte, Block4Mb) }}
	BlockPool8M   = sync.Pool{New: func() interface{} { return make([]byte, legacyBlockSize) }}
)

Functions

func CompressBlock

func CompressBlock(src, dst []byte) (int, error)

func CompressBlockBound

func CompressBlockBound(n int) int

func CompressBlockHC

func CompressBlockHC(src, dst []byte, depth CompressionLevel) (int, error)

func IsValid

func IsValid(b uint32) bool

func Put

func Put(buf []byte)

func UncompressBlock

func UncompressBlock(src, dst []byte) (int, error)

Types

type BlockSizeIndex

type BlockSizeIndex uint8

func Index

func Index(b uint32) BlockSizeIndex

func (BlockSizeIndex) Get

func (b BlockSizeIndex) Get() []byte

func (BlockSizeIndex) IsValid

func (b BlockSizeIndex) IsValid() bool

type CompressionLevel

type CompressionLevel uint32
const Fast CompressionLevel = 0

type Compressor

type Compressor struct {
	// contains filtered or unexported fields
}

func (*Compressor) CompressBlock

func (c *Compressor) CompressBlock(src, dst []byte) (int, error)

type CompressorHC

type CompressorHC struct {
	// contains filtered or unexported fields
}

func (*CompressorHC) CompressBlock

func (c *CompressorHC) CompressBlock(src, dst []byte, depth CompressionLevel) (_ int, err error)

Jump to

Keyboard shortcuts

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