bits

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 1 Imported by: 31

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

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

WriteBits 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