arithmetic

package
v0.0.0-...-4936527 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxCode       = 0xffff
	OneFourth     = 0x4000
	OneHalf       = 2 * OneFourth
	ThreeFourths  = 3 * OneFourth
	CodeValueBits = 16
	MaxFreq       = 16383
)
View Source
const BYTE_SIZE = 8

Variables

This section is empty.

Functions

func Compress

func Compress(input []byte) []byte

Compress takes a slice of bytes and returns a slice of bytes representing the compressed stream

func Decompress

func Decompress(input []byte) []byte

Decompress takes a slice of bytes and returns a slice of bytes representing the decompressed stream

func FromByteSlice

func FromByteSlice(bytes []byte) bitSlice

func GetNextBit

func GetNextBit(bits bitSlice) (uint32, bitSlice)

func NewReader

func NewReader(r io.Reader) io.Reader

func NewWriter

func NewWriter(w io.Writer) io.WriteCloser

func PushBits

func PushBits(bits bitSlice, bit bool, pendingBits int) bitSlice

func PushBitsPending

func PushBitsPending(pendingBits int, bit bool) bitSlice

Types

type Model

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

type Reader

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

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Read

func (r *Reader) Read(content []byte) (n int, err error)

type Writer

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

func (*Writer) Close

func (writer *Writer) Close() error

func (*Writer) Write

func (writer *Writer) Write(data []byte) (n int, err error)

Jump to

Keyboard shortcuts

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