fast

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitArray

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

BitArray stores only first <1,2,4> bits of each of <count> numbers.

func NewBitArray

func NewBitArray(bits, count uint) *BitArray

NewBitArray makes bits array of int.

func (*BitArray) Reader

func (a *BitArray) Reader(r []byte) *BitArrayReader

Reader is a number unpacker.

func (*BitArray) Size

func (a *BitArray) Size() int

Size is a bytes count.

func (*BitArray) Writer

func (a *BitArray) Writer(w []byte) *BitArrayWriter

Writer is a number packer.

type BitArrayReader

type BitArrayReader struct {
	BitArray
	// contains filtered or unexported fields
}

BitArrayReader of numbers from BitArray.

func (*BitArrayReader) Pop

func (a *BitArrayReader) Pop() int

Pop number from array.

type BitArrayWriter

type BitArrayWriter struct {
	BitArray
	// contains filtered or unexported fields
}

BitArrayWriter of numbers to BitArray.

func (*BitArrayWriter) Push

func (a *BitArrayWriter) Push(v int)

Push bits of number into array.

type Buffer

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

Buffer is a fixed-sized buffer of byte with Read and Write methods.

func NewBuffer

func NewBuffer(bb []byte) *Buffer

NewBuffer wraps bytes with buffer.

func (*Buffer) Position

func (b *Buffer) Position() int

Position of internal cursor.

func (*Buffer) Read

func (b *Buffer) Read(n int) []byte

Read n bytes.

func (*Buffer) Write

func (b *Buffer) Write(v []byte)

Write the byte to the buffer.

func (*Buffer) WriteByte

func (b *Buffer) WriteByte(v byte)

WriteByte to the buffer.

Jump to

Keyboard shortcuts

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