Documentation ¶
Index ¶
- type ByteFrame
- func (b *ByteFrame) Data() []byte
- func (b *ByteFrame) DataFromCurrent() []byte
- func (b *ByteFrame) ReadBool() (x bool)
- func (b *ByteFrame) ReadBytes(size uint) (x []byte)
- func (b *ByteFrame) ReadFloat32() (x float32)
- func (b *ByteFrame) ReadFloat64() (x float64)
- func (b *ByteFrame) ReadInt16() (x int16)
- func (b *ByteFrame) ReadInt32() (x int32)
- func (b *ByteFrame) ReadInt64() (x int64)
- func (b *ByteFrame) ReadInt8() (x int8)
- func (b *ByteFrame) ReadNullTerminatedBytes() []byte
- func (b *ByteFrame) ReadUint16() (x uint16)
- func (b *ByteFrame) ReadUint32() (x uint32)
- func (b *ByteFrame) ReadUint64() (x uint64)
- func (b *ByteFrame) ReadUint8() (x uint8)
- func (b *ByteFrame) Seek(offset int64, whence int) (int64, error)
- func (b *ByteFrame) SetBE()
- func (b *ByteFrame) SetLE()
- func (b *ByteFrame) WriteBool(x bool)
- func (b *ByteFrame) WriteBytes(x []byte)
- func (b *ByteFrame) WriteFloat32(x float32)
- func (b *ByteFrame) WriteFloat64(x float64)
- func (b *ByteFrame) WriteInt16(x int16)
- func (b *ByteFrame) WriteInt32(x int32)
- func (b *ByteFrame) WriteInt64(x int64)
- func (b *ByteFrame) WriteInt8(x int8)
- func (b *ByteFrame) WriteNullTerminatedBytes(x []byte)
- func (b *ByteFrame) WriteUint16(x uint16)
- func (b *ByteFrame) WriteUint32(x uint32)
- func (b *ByteFrame) WriteUint64(x uint64)
- func (b *ByteFrame) WriteUint8(x uint8)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteFrame ¶
type ByteFrame struct {
// contains filtered or unexported fields
}
ByteFrame is a struct for reading and writing raw byte data.
func NewByteFrame ¶
func NewByteFrame() *ByteFrame
NewByteFrame creates a new ByteFrame with valid default values. byteOrder defaults to big endian.
func NewByteFrameFromBytes ¶
NewByteFrameFromBytes creates a new ByteFrame with valid default values. makes a copy of the given buf and initalizes with it. byteOrder defaults to big endian.
func (*ByteFrame) DataFromCurrent ¶
DataFromCurrent returns the data from the current index up to the max index.
func (*ByteFrame) ReadBool ¶
ReadBool reads a bool at the current index (1 byte. b > 0 -> true, b == 0 -> false)
func (*ByteFrame) ReadFloat32 ¶
ReadFloat32 reads a float32 at the current index.
func (*ByteFrame) ReadFloat64 ¶
ReadFloat64 reads a float64 at the current index.
func (*ByteFrame) ReadNullTerminatedBytes ¶
ReadNullTerminatedBytes reads bytes up to a NULL terminator.
func (*ByteFrame) ReadUint16 ¶
ReadUint16 reads a uint16 at the current index.
func (*ByteFrame) ReadUint32 ¶
ReadUint32 reads a uint32 at the current index.
func (*ByteFrame) ReadUint64 ¶
ReadUint64 reads a uint64 at the current index.
func (*ByteFrame) WriteBool ¶
WriteBool writes a bool at the current index (1 byte. true -> 1, false -> 0)
func (*ByteFrame) WriteBytes ¶
WriteBytes writes a slice of bytes at the current index.
func (*ByteFrame) WriteFloat32 ¶
WriteFloat32 writes a float32 at the current index.
func (*ByteFrame) WriteFloat64 ¶
WriteFloat64 writes a float64 at the current index
func (*ByteFrame) WriteInt16 ¶
WriteInt16 writes a int16 at the current index.
func (*ByteFrame) WriteInt32 ¶
WriteInt32 writes a int32 at the current index.
func (*ByteFrame) WriteInt64 ¶
WriteInt64 writes a int64 at the current index.
func (*ByteFrame) WriteNullTerminatedBytes ¶
WriteNullTerminatedBytes write a slice bytes with an additional NULL terminator.
func (*ByteFrame) WriteUint16 ¶
WriteUint16 writes a uint16 at the current index.
func (*ByteFrame) WriteUint32 ¶
WriteUint32 writes a uint32 at the current index.
func (*ByteFrame) WriteUint64 ¶
WriteUint64 writes a uint64 at the current index.
func (*ByteFrame) WriteUint8 ¶
WriteUint8 writes a uint8 at the current index.