bits

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 1 Imported by: 30

Documentation

Overview

Package bits contains functions to read/write bits from/to buffers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasSpace

func HasSpace(buf []byte, pos int, n int) error

HasSpace checks whether buffer has space for N bits.

func ReadBits

func ReadBits(buf []byte, pos *int, n int) (uint64, error)

ReadBits reads N bits.

func ReadBitsUnsafe

func ReadBitsUnsafe(buf []byte, pos *int, n int) uint64

ReadBitsUnsafe reads N bits.

func ReadFlag

func ReadFlag(buf []byte, pos *int) (bool, error)

ReadFlag reads a boolean flag.

func ReadFlagUnsafe

func ReadFlagUnsafe(buf []byte, pos *int) bool

ReadFlagUnsafe reads a boolean flag.

func ReadGolombSigned

func ReadGolombSigned(buf []byte, pos *int) (int32, error)

ReadGolombSigned reads a signed golomb-encoded value.

func ReadGolombUnsigned

func ReadGolombUnsigned(buf []byte, pos *int) (uint32, error)

ReadGolombUnsigned reads an unsigned golomb-encoded value.

func WriteBits deprecated

func WriteBits(buf []byte, pos *int, v uint64, n int)

WriteBits writes N bits.

Deprecated: replaced by WriteBitsUnsafe.

func WriteBitsUnsafe added in v1.13.1

func WriteBitsUnsafe(buf []byte, pos *int, v uint64, n int)

WriteBitsUnsafe writes N bits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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