gz

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireBuffer

func AcquireBuffer() *bytes.Buffer

AcquireBuffer returns a pooled *bytes.Buffer with length 0.

func AcquireWriter

func AcquireWriter(w io.Writer) *cgzip.Writer

AcquireWriter returns a pooled *gzip.Writer reset to write into w.

func Encode

func Encode(p []byte) ([]byte, error)

Encode compresses p and returns a detached []byte.

func EncodeToBuffer

func EncodeToBuffer(p []byte) (*bytes.Buffer, error)

EncodeToBuffer compresses p and returns a pooled buffer holding the result.

func EncodeToWriter

func EncodeToWriter(w io.Writer, p []byte) error

EncodeToWriter compresses p and writes the result to w using a pooled writer.

func ReleaseBuffer

func ReleaseBuffer(buf *bytes.Buffer)

ReleaseBuffer returns the buffer to the pool.

func ReleaseWriter

func ReleaseWriter(gw *cgzip.Writer) error

ReleaseWriter closes the writer (flushes) and returns it to the pool.

Types

This section is empty.

Jump to

Keyboard shortcuts

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