Documentation ¶
Overview ¶
Package binaryreader provides a convenient reader to decode (big endian) binary content.
Index ¶
- type Reader
- func (r *Reader) Byte() (byte, error)
- func (r *Reader) Data() []byte
- func (r *Reader) FixedSizes(count, size int) ([]byte, error)
- func (r *Reader) Int16s(count int) ([]int16, error)
- func (r *Reader) Read(out []byte) (int, error)
- func (r *Reader) ReadStruct(out interface{}) error
- func (r *Reader) SetPos(pos int)
- func (r *Reader) Skip(count int)
- func (r *Reader) Uint16() (uint16, error)
- func (r *Reader) Uint16s(count int) ([]uint16, error)
- func (r *Reader) Uint32() (uint32, error)
- func (r *Reader) Uint32s(count int) ([]uint32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader holds a byte slice and provide convenient methods to interpret its content.
func NewReaderAt ¶
NewReaderAt returns a reader filled with `data[offset:]`.
func (*Reader) Byte ¶
Byte reads one byte and advances. The only error possible is reaching the end of the slice.
func (*Reader) FixedSizes ¶
FixedSizes return a slice with length count*size, and advances
func (*Reader) ReadStruct ¶
ReadStruct calls binary.Read and advances. The only error possible is reaching the end of the slice.
func (*Reader) Uint16 ¶
Uint16 reads one uint16 and advances. The only error possible is reaching the end of the slice.
Click to show internal directories.
Click to hide internal directories.