compress

package
v0.0.0-...-11fc026 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MaxUint32 = ^uint32(0)

MaxUint32 is the largest unsigned integer.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressionBuffer

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

CompressionBuffer holds compressed data and provides methods to compress it.

func NewCompressionBuffer

func NewCompressionBuffer() CompressionBuffer

NewCompressionBuffer creates a new empty compression buffer.

func (*CompressionBuffer) Bytes

func (c *CompressionBuffer) Bytes() []byte

Bytes returns the remaining bytes from the buffer.

func (*CompressionBuffer) Compress

func (c *CompressionBuffer) Compress(data []float64)

Compress takes data as input, compresses it, and puts it into the buffer.

func (*CompressionBuffer) Finalize

func (c *CompressionBuffer) Finalize()

Finalize the buffer and process whatever remaining bytes we have. Omit trailing zero valued bytes.

type DecompressionBuffer

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

DecompressionBuffer holds compressed data and provides methods for decompressing it.

func NewDecompressionBuffer

func NewDecompressionBuffer(data []byte, expectedSize int) DecompressionBuffer

NewDecompressionBuffer creates a buffer with the given compressed contents.

func (*DecompressionBuffer) Decompress

func (d *DecompressionBuffer) Decompress() []float64

Decompress uses the compressed buffer contents to create a []float64.

func (*DecompressionBuffer) ReadBit

func (d *DecompressionBuffer) ReadBit() bool

ReadBit returns a single bit from the buffer.

func (*DecompressionBuffer) ReadBits

func (d *DecompressionBuffer) ReadBits(n uint32) uint64

ReadBits returns several bits (up to 64) from the buffer in a uint64.

Jump to

Keyboard shortcuts

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