native

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: Zlib Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor

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

Compressor using an underlying C zlib stream to compress (deflate) data

func NewCompressor

func NewCompressor(lvl int) (*Compressor, error)

NewCompressor returns and initializes a new Compressor with zlib compression stream initialized

func NewCompressorStrategy

func NewCompressorStrategy(lvl, strat int) (*Compressor, error)

NewCompressorStrategy returns and initializes a new Compressor with given level and strategy with zlib compression stream initialized

func (*Compressor) Close

func (c *Compressor) Close() error

Close closes the underlying zlib stream and frees the allocated memory

func (*Compressor) Compress

func (c *Compressor) Compress(in []byte) ([]byte, error)

Compress compresses the given data and returns it as byte slice

func (*Compressor) IsClosed

func (c *Compressor) IsClosed() bool

IsClosed returns whether the StreamCloser has closed the underlying stream

type Decompressor

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

Decompressor using an underlying c zlib stream to decompress (inflate) data

func NewDecompressor

func NewDecompressor() (*Decompressor, error)

NewDecompressor returns and initializes a new Decompressor with zlib compression stream initialized

func (*Decompressor) Close

func (c *Decompressor) Close() error

Close closes the underlying zlib stream and frees the allocated memory

func (*Decompressor) Decompress

func (c *Decompressor) Decompress(in []byte) (int, []byte, error)

Decompress decompresses the given data and returns it as byte slice

func (*Decompressor) IsClosed

func (c *Decompressor) IsClosed() bool

IsClosed returns whether the StreamCloser has closed the underlying stream

type StreamCloser

type StreamCloser interface {
	// IsClosed returns whether the StreamCloser has closed the underlying stream
	IsClosed() bool
}

StreamCloser can indicate whether their underlying stream is closed. If so, the StreamCloser must not be used anymore

Jump to

Keyboard shortcuts

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