native

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: MIT Imports: 3 Imported by: 1

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 compresses data to zlib format at the specified level

func NewCompressor

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

NewCompressor returns a new Compressor used to compress data. Errors if out of memory or invalid lvl

func (*Compressor) Close

func (c *Compressor) Close()

Close frees the memory allocated by C objects

func (*Compressor) Compress

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

Compress compresses the data from in to out and returns the number of bytes written to out, out and an error if the out buffer was too short. If you pass nil for out, this function will allocate a fitting buffer and return it.

Jump to

Keyboard shortcuts

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