Documentation
¶
Index ¶
- Constants
- type ByteBuffer
- func (b *ByteBuffer) Advance(len int) int
- func (b ByteBuffer) Buffer() []byte
- func (b ByteBuffer) Data() []byte
- func (b ByteBuffer) Index() int
- func (b ByteBuffer) Length() int
- func (b *ByteBuffer) ReadByte() byte
- func (b *ByteBuffer) ReadBytes(size int) []byte
- func (b *ByteBuffer) ReadFloat64() float64
- func (b *ByteBuffer) ReadFloat64BE() float64
- func (b *ByteBuffer) ReadInt16() int16
- func (b *ByteBuffer) ReadInt16BE() int16
- func (b *ByteBuffer) ReadInt32() int32
- func (b *ByteBuffer) ReadInt32BE() int32
- func (b *ByteBuffer) ReadInt64() int64
- func (b *ByteBuffer) ReadInt64BE() int64
- func (b *ByteBuffer) ReadInt8() int8
- func (b *ByteBuffer) ReadUInt16() uint16
- func (b *ByteBuffer) ReadUInt16BE() uint16
- func (b *ByteBuffer) ReadUInt32() uint32
- func (b *ByteBuffer) ReadUInt32BE() uint32
- func (b *ByteBuffer) ReadUInt64() uint64
- func (b *ByteBuffer) ReadUInt64BE() uint64
- func (b *ByteBuffer) ReadUInt8() uint8
- func (b *ByteBuffer) Seek(pos int) int
- func (b *ByteBuffer) UpdateLength()
- func (b *ByteBuffer) WriteByte(val byte)
- func (b *ByteBuffer) WriteBytes(data []byte)
- func (b *ByteBuffer) WriteFloat64(val float64)
- func (b *ByteBuffer) WriteFloat64BE(val float64)
- func (b *ByteBuffer) WriteInt16(val int16)
- func (b *ByteBuffer) WriteInt16BE(val int16)
- func (b *ByteBuffer) WriteInt32(val int32)
- func (b *ByteBuffer) WriteInt32BE(val int32)
- func (b *ByteBuffer) WriteInt64(val int64)
- func (b *ByteBuffer) WriteInt64BE(val int64)
- func (b *ByteBuffer) WriteInt8(val int8)
- func (b *ByteBuffer) WriteUInt16(val uint16)
- func (b *ByteBuffer) WriteUInt16BE(val uint16)
- func (b *ByteBuffer) WriteUInt32(val uint32)
- func (b *ByteBuffer) WriteUInt32BE(val uint32)
- func (b *ByteBuffer) WriteUInt64(val uint64)
- func (b *ByteBuffer) WriteUInt64BE(val uint64)
- func (b *ByteBuffer) WriteUInt8(val uint8)
Constants ¶
const VERSION = "0.2.0"
VERSION is the version of the package.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteBuffer ¶
type ByteBuffer struct {
// contains filtered or unexported fields
}
ByteBuffer is used to read and write data to a byte array.
func ByteBufferFrom ¶
func ByteBufferFrom(data []byte) *ByteBuffer
ByteBufferFrom creates a new ByteBuffer from a byte array.
func (*ByteBuffer) Advance ¶
func (b *ByteBuffer) Advance(len int) int
Advance moves the index forward by the specified amount.
func (ByteBuffer) Buffer ¶
func (b ByteBuffer) Buffer() []byte
Buffer returns the underlying byte array.
func (ByteBuffer) Data ¶
func (b ByteBuffer) Data() []byte
Data returns a slice of the underlying byte array starting at the current index.
func (ByteBuffer) Length ¶
func (b ByteBuffer) Length() int
Length returns the length of the buffer.
func (*ByteBuffer) ReadByte ¶ added in v0.2.0
func (b *ByteBuffer) ReadByte() byte
GetByte returns the byte at the current index.
func (*ByteBuffer) ReadBytes ¶ added in v0.2.0
func (b *ByteBuffer) ReadBytes(size int) []byte
func (*ByteBuffer) ReadFloat64 ¶ added in v0.2.0
func (b *ByteBuffer) ReadFloat64() float64
func (*ByteBuffer) ReadFloat64BE ¶ added in v0.2.0
func (b *ByteBuffer) ReadFloat64BE() float64
func (*ByteBuffer) ReadInt16 ¶ added in v0.2.0
func (b *ByteBuffer) ReadInt16() int16
ReadInt16 returns the int16 at the current index.
func (*ByteBuffer) ReadInt16BE ¶ added in v0.2.0
func (b *ByteBuffer) ReadInt16BE() int16
func (*ByteBuffer) ReadInt32 ¶ added in v0.2.0
func (b *ByteBuffer) ReadInt32() int32
func (*ByteBuffer) ReadInt32BE ¶ added in v0.2.0
func (b *ByteBuffer) ReadInt32BE() int32
func (*ByteBuffer) ReadInt64 ¶ added in v0.2.0
func (b *ByteBuffer) ReadInt64() int64
func (*ByteBuffer) ReadInt64BE ¶ added in v0.2.0
func (b *ByteBuffer) ReadInt64BE() int64
func (*ByteBuffer) ReadInt8 ¶ added in v0.2.0
func (b *ByteBuffer) ReadInt8() int8
ReadInt8 returns the int8 at the current index.
func (*ByteBuffer) ReadUInt16 ¶ added in v0.2.0
func (b *ByteBuffer) ReadUInt16() uint16
func (*ByteBuffer) ReadUInt16BE ¶ added in v0.2.0
func (b *ByteBuffer) ReadUInt16BE() uint16
func (*ByteBuffer) ReadUInt32 ¶ added in v0.2.0
func (b *ByteBuffer) ReadUInt32() uint32
func (*ByteBuffer) ReadUInt32BE ¶ added in v0.2.0
func (b *ByteBuffer) ReadUInt32BE() uint32
func (*ByteBuffer) ReadUInt64 ¶ added in v0.2.0
func (b *ByteBuffer) ReadUInt64() uint64
func (*ByteBuffer) ReadUInt64BE ¶ added in v0.2.0
func (b *ByteBuffer) ReadUInt64BE() uint64
func (*ByteBuffer) ReadUInt8 ¶ added in v0.2.0
func (b *ByteBuffer) ReadUInt8() uint8
ReadUInt8 returns the uint8 at the current index.
func (*ByteBuffer) Seek ¶
func (b *ByteBuffer) Seek(pos int) int
Seek sets the current index to the specified value.
func (*ByteBuffer) UpdateLength ¶
func (b *ByteBuffer) UpdateLength()
UpdateLength updates the length of the buffer.
func (*ByteBuffer) WriteByte ¶ added in v0.2.0
func (b *ByteBuffer) WriteByte(val byte)
SetByte sets the byte at the current index.
func (*ByteBuffer) WriteBytes ¶ added in v0.2.0
func (b *ByteBuffer) WriteBytes(data []byte)
func (*ByteBuffer) WriteFloat64 ¶ added in v0.2.0
func (b *ByteBuffer) WriteFloat64(val float64)
func (*ByteBuffer) WriteFloat64BE ¶ added in v0.2.0
func (b *ByteBuffer) WriteFloat64BE(val float64)
func (*ByteBuffer) WriteInt16 ¶ added in v0.2.0
func (b *ByteBuffer) WriteInt16(val int16)
func (*ByteBuffer) WriteInt16BE ¶ added in v0.2.0
func (b *ByteBuffer) WriteInt16BE(val int16)
func (*ByteBuffer) WriteInt32 ¶ added in v0.2.0
func (b *ByteBuffer) WriteInt32(val int32)
func (*ByteBuffer) WriteInt32BE ¶ added in v0.2.0
func (b *ByteBuffer) WriteInt32BE(val int32)
func (*ByteBuffer) WriteInt64 ¶ added in v0.2.0
func (b *ByteBuffer) WriteInt64(val int64)
func (*ByteBuffer) WriteInt64BE ¶ added in v0.2.0
func (b *ByteBuffer) WriteInt64BE(val int64)
func (*ByteBuffer) WriteInt8 ¶ added in v0.2.0
func (b *ByteBuffer) WriteInt8(val int8)
WriteInt8 sets the int8 at the current index.
func (*ByteBuffer) WriteUInt16 ¶ added in v0.2.0
func (b *ByteBuffer) WriteUInt16(val uint16)
func (*ByteBuffer) WriteUInt16BE ¶ added in v0.2.0
func (b *ByteBuffer) WriteUInt16BE(val uint16)
func (*ByteBuffer) WriteUInt32 ¶ added in v0.2.0
func (b *ByteBuffer) WriteUInt32(val uint32)
func (*ByteBuffer) WriteUInt32BE ¶ added in v0.2.0
func (b *ByteBuffer) WriteUInt32BE(val uint32)
func (*ByteBuffer) WriteUInt64 ¶ added in v0.2.0
func (b *ByteBuffer) WriteUInt64(val uint64)
func (*ByteBuffer) WriteUInt64BE ¶ added in v0.2.0
func (b *ByteBuffer) WriteUInt64BE(val uint64)
func (*ByteBuffer) WriteUInt8 ¶ added in v0.2.0
func (b *ByteBuffer) WriteUInt8(val uint8)
WriteUInt8 sets the uint8 at the current index.