Documentation ¶
Overview ¶
Package lz4block provides LZ4 BlockSize types and pools of buffers.
Index ¶
- Constants
- Variables
- func CompressBlock(src, dst []byte) (int, error)
- func CompressBlockBound(n int) int
- func CompressBlockHC(src, dst []byte, depth CompressionLevel) (int, error)
- func IsValid(b uint32) bool
- func Put(buf []byte)
- func UncompressBlock(src, dst []byte) (int, error)
- type BlockSizeIndex
- type CompressionLevel
- type Compressor
- type CompressorHC
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 CompressBlockBound ¶
func CompressBlockHC ¶
func CompressBlockHC(src, dst []byte, depth CompressionLevel) (int, error)
func UncompressBlock ¶
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 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)
Click to show internal directories.
Click to hide internal directories.