bitstream

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAlphanumeric

func DecodeAlphanumeric(buf *Buffer, data []byte) error

func DecodeBytes

func DecodeBytes(buf *Buffer, data []byte) error

func DecodeKanji

func DecodeKanji(buf *Buffer, length int) ([]byte, error)

func DecodeNumeric

func DecodeNumeric(buf *Buffer, data []byte) error

func EncodeAlphanumeric

func EncodeAlphanumeric(buf *Buffer, data []byte) error

func EncodeBytes

func EncodeBytes(buf *Buffer, data []byte) error

func EncodeKanji

func EncodeKanji(buf *Buffer, data []byte) error

func EncodeNumeric

func EncodeNumeric(buf *Buffer, data []byte) error

func IsAlphanumeric

func IsAlphanumeric(ch byte) bool

func IsKanji

func IsKanji(ch rune) bool

func IsNumeric

func IsNumeric(ch byte) bool

Types

type Buffer

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

func NewBuffer

func NewBuffer(data []byte) *Buffer

NewBuffer returns a buffer for bits sequence data. The bits sequence starts from MSB of the first byte.

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

func (*Buffer) Len

func (b *Buffer) Len() int

Len returns the number of bits of the buffer.

func (*Buffer) ReadBit

func (b *Buffer) ReadBit() (uint8, error)

ReadBit reads one bit from b.

func (*Buffer) ReadBits

func (b *Buffer) ReadBits(n int) (uint64, error)

func (*Buffer) WriteBit

func (b *Buffer) WriteBit(bit uint8) error

WriteBit writes one bit to b.

func (*Buffer) WriteBitsLSB

func (b *Buffer) WriteBitsLSB(bits uint64, n int) error

WriteBitsLSB writes n bits of LSB to b. if n > 64, it panics.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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