Documentation
¶
Overview ¶
Provides some basic wrapper interfaces around byte arrays to operate on them as bitstreams.
Index ¶
- type BitStreamOps
- func (b *BitStreamOps) Append(s []byte)
- func (b *BitStreamOps) BIndex() uint
- func (b *BitStreamOps) Buffer() []byte
- func (b *BitStreamOps) Collect(numbits int) (ret uint, err error)
- func (b *BitStreamOps) CollectAll() []byte
- func (b *BitStreamOps) CollectByte() (ret uint, err error)
- func (b *BitStreamOps) CollectDWord() (ret uint, err error)
- func (b *BitStreamOps) CollectWord() (ret uint, err error)
- func (b *BitStreamOps) Concat(s string)
- func (b *BitStreamOps) DeAppend(n int) ([]byte, error)
- func (b *BitStreamOps) DeConcat(n int) (string, error)
- func (b *BitStreamOps) Emit(val uint, numbits int) (err error)
- func (b *BitStreamOps) EmitByte(val uint8)
- func (b *BitStreamOps) EmitDWord(val uint32)
- func (b *BitStreamOps) EmitWord(val uint16)
- func (b *BitStreamOps) HasMoreBytes() bool
- func (b *BitStreamOps) Index() uint
- func (b *BitStreamOps) JumpToNextByte()
- func (b *BitStreamOps) JumpToNextByteForRead()
- func (b *BitStreamOps) WriteToFile(fname string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitStreamOps ¶
type BitStreamOps struct {
// contains filtered or unexported fields
}
func NewBitStreamOps ¶
func NewBitStreamOps() *BitStreamOps
func NewBitStreamOpsReader ¶
func NewBitStreamOpsReader(b []byte) *BitStreamOps
func (*BitStreamOps) Append ¶
func (b *BitStreamOps) Append(s []byte)
/ Append and Concat assumes byte boundaries are all settled and in order
func (*BitStreamOps) BIndex ¶
func (b *BitStreamOps) BIndex() uint
func (*BitStreamOps) Buffer ¶
func (b *BitStreamOps) Buffer() []byte
func (*BitStreamOps) CollectAll ¶
func (b *BitStreamOps) CollectAll() []byte
func (*BitStreamOps) CollectByte ¶
func (b *BitStreamOps) CollectByte() (ret uint, err error)
** Jump to next byte boundary before calling Collect on data more than 1 bit
func (*BitStreamOps) CollectDWord ¶
func (b *BitStreamOps) CollectDWord() (ret uint, err error)
func (*BitStreamOps) CollectWord ¶
func (b *BitStreamOps) CollectWord() (ret uint, err error)
func (*BitStreamOps) Concat ¶
func (b *BitStreamOps) Concat(s string)
func (*BitStreamOps) EmitByte ¶
func (b *BitStreamOps) EmitByte(val uint8)
** Call JumpToNextByte before calling emit on data more than 1 bit
func (*BitStreamOps) EmitDWord ¶
func (b *BitStreamOps) EmitDWord(val uint32)
func (*BitStreamOps) EmitWord ¶
func (b *BitStreamOps) EmitWord(val uint16)
func (*BitStreamOps) HasMoreBytes ¶
func (b *BitStreamOps) HasMoreBytes() bool
func (*BitStreamOps) Index ¶
func (b *BitStreamOps) Index() uint
func (*BitStreamOps) JumpToNextByte ¶
func (b *BitStreamOps) JumpToNextByte()
** Does not check end of buffer (so that it can be used for r/w)
func (*BitStreamOps) JumpToNextByteForRead ¶
func (b *BitStreamOps) JumpToNextByteForRead()
func (*BitStreamOps) WriteToFile ¶
func (b *BitStreamOps) WriteToFile(fname string) (err error)
Click to show internal directories.
Click to hide internal directories.