Documentation ¶
Index ¶
- Variables
- func GetBit16(v []byte, pos uint) uint8
- func GetBit8(v uint8, pos uint) uint8
- func GetBits16(v []byte, pos uint, n uint) uint16
- func GetBits8(v uint8, pos uint, n uint) uint8
- type BitReader
- func (br *BitReader) AvailBits() (uint, error)
- func (br *BitReader) Err() error
- func (br *BitReader) ReadBit() (uint8, error)
- func (br *BitReader) ReadBits16(n uint) (r uint16, err error)
- func (br *BitReader) ReadBits32(n uint) (r uint32, err error)
- func (br *BitReader) ReadBits64(n uint) (r uint64, err error)
- func (br *BitReader) ReadBits8(n uint) (r uint8, err error)
- func (br *BitReader) ReadBytes(n uint) (r []byte, err error)
- func (br *BitReader) ReadGolomb() (v uint32, err error)
- func (br *BitReader) ReadSeGolomb() (v int32, err error)
- func (br *BitReader) ReadUeGolomb() (v uint32, err error)
- func (br *BitReader) SkipBits(n uint) error
- func (br *BitReader) SkipBytes(n uint) error
- type BitWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNazaBits = errors.New("nazabits: fxxk")
Functions ¶
Types ¶
type BitReader ¶
type BitReader struct {
// contains filtered or unexported fields
}
按位流式读取字节切片 从高位向低位读 注意,可以在每次读取后,判断是否发生错误。也可以在多次读取后,判断是否发生错误。
func NewBitReader ¶
func (*BitReader) ReadBits16 ¶
@param n: 取值范围 [1, 16]
func (*BitReader) ReadBits32 ¶
@param n: 取值范围 [1, 32]
func (*BitReader) ReadBits64 ¶
@param n: 取值范围 [1, 64]
func (*BitReader) ReadGolomb ¶
func (*BitReader) ReadSeGolomb ¶
ReadSeGolomb 哥伦布编码,有符号
func (*BitReader) ReadUeGolomb ¶
ReadUeGolomb 0阶指数哥伦布编码,无符号
type BitWriter ¶
type BitWriter struct {
// contains filtered or unexported fields
}
func NewBitWriter ¶
func (*BitWriter) WriteBits16 ¶
func (*BitWriter) WriteBits8 ¶
将<v>的低<n>位写入 @param n: 取值范围 [1, 8]
Click to show internal directories.
Click to hide internal directories.