bits

package
v0.0.0-...-118f76d Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitReader

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

BitReader reads bit by bit from an underlying reader.

func NewBitReader

func NewBitReader(reader io.ByteReader) *BitReader

NewBitReader creates BitReader instance.

func (*BitReader) BitCount

func (reader *BitReader) BitCount() int

BitCount gets amount of read bits.

func (*BitReader) Flush

func (reader *BitReader) Flush() (byte, error)

Flush alignes to the next byte.

func (*BitReader) ReadBit

func (reader *BitReader) ReadBit() (byte, error)

ReadBit reads a bit.

func (*BitReader) ReadUint16

func (reader *BitReader) ReadUint16() (uint16, error)

ReadUint16 reads an uint16.

func (*BitReader) ReadUint32

func (reader *BitReader) ReadUint32() (uint32, error)

ReadUint32 reads an uint32.

func (*BitReader) ReadUint8

func (reader *BitReader) ReadUint8() (uint8, error)

ReadUint8 reads an uint8.

type BitWriter

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

BitWriter writes bit by bit to an underlying writer.

func NewBitWriter

func NewBitWriter(writer io.ByteWriter) *BitWriter

NewBitWriter creates BitWriter instance.

func (*BitWriter) BitCount

func (writer *BitWriter) BitCount() int

BitCount gets amount of written bits.

func (*BitWriter) Flush

func (writer *BitWriter) Flush() error

Flush alignes to the next byte.

func (*BitWriter) WriteBit

func (writer *BitWriter) WriteBit(value byte) error

WriteBit writes a bit.

func (*BitWriter) WriteUint16

func (writer *BitWriter) WriteUint16(value uint16) error

WriteUint16 writes an uint16.

func (*BitWriter) WriteUint32

func (writer *BitWriter) WriteUint32(value uint32) error

WriteUint32 writes an uint32.

func (*BitWriter) WriteUint8

func (writer *BitWriter) WriteUint8(value byte) error

WriteUint8 writes an uint8.

Jump to

Keyboard shortcuts

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