gzip

package
v0.0.67 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBufferSize = 65536

DefaultBufferSize is the default buffer size used by the Compressor.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor

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

Compressor is a wrapper around a gzip.Writer that reads from an io.Reader and writes to an internal buffer. The internal buffer is used to store compressed data until it is read by the caller.

func NewCompressor

func NewCompressor(r io.Reader, bufSz int) (*Compressor, error)

NewCompressor returns an instantiated Compressor that reads from r and compresses the data using gzip.

func (*Compressor) Close

func (c *Compressor) Close() error

Close closes the Compressor.

func (*Compressor) Read

func (c *Compressor) Read(p []byte) (n int, err error)

Read reads compressed data.

type Decompressor

type Decompressor struct {
	*gzip.Reader
}

Decompressor is a wrapper around a gzip.Reader that reads from an io.Reader and decompresses the data.

func NewDecompressor

func NewDecompressor(r io.Reader) *Decompressor

NewDecompressor returns an instantied Decompressor that reads from r and decompresses the data using gzip.

Jump to

Keyboard shortcuts

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