zlib

package
v2.13.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Level

func Level(level int) compressions.CompressorAttr

Level 设置 zlib 压缩等级:

-1 = DefaultCompression(默认推荐)
 0 = NoCompression(无压缩)
 1 = BestSpeed(最快速度)
 9 = BestCompression(最高压缩率)
-2 = HuffmanOnly(仅 Huffman 编码)

func New

New 实例化

Types

type Zlib

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

func (*Zlib) Decode

func (my *Zlib) Decode() (decompressed []byte, err error)

Decode 解压缩

func (*Zlib) Encode

func (my *Zlib) Encode() (compressed []byte, err error)

Encode 压缩

func (*Zlib) SetAttrs

func (my *Zlib) SetAttrs(attrs ...compressions.CompressorAttr) (err error)

func (*Zlib) SetData

func (my *Zlib) SetData(data []byte)

func (*Zlib) SetLevel

func (my *Zlib) SetLevel(level int)

Jump to

Keyboard shortcuts

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