Documentation ¶
Index ¶
- Variables
- func ByteLenVarInt(x int64) int64
- func ByteLenVarUint(x uint64) int64
- type Buffer
- func (b *Buffer) Bytes() []byte
- func (b *Buffer) Capacity() int64
- func (b *Buffer) EnsureCap(n int64)
- func (b *Buffer) Grow(n int64)
- func (b *Buffer) Offset() int64
- func (b *Buffer) ReadByte() byte
- func (b *Buffer) ReadBytes(n int64) []byte
- func (b *Buffer) ReadFloat32BE() float32
- func (b *Buffer) ReadFloat32LE() float32
- func (b *Buffer) ReadFloat64BE() float64
- func (b *Buffer) ReadFloat64LE() float64
- func (b *Buffer) ReadInt16BE() int16
- func (b *Buffer) ReadInt16LE() int16
- func (b *Buffer) ReadInt32BE() int32
- func (b *Buffer) ReadInt32LE() int32
- func (b *Buffer) ReadInt64BE() int64
- func (b *Buffer) ReadInt64LE() int64
- func (b *Buffer) ReadInt8() int8
- func (b *Buffer) ReadString() string
- func (b *Buffer) ReadStringPtr() *string
- func (b *Buffer) ReadUint16BE() uint16
- func (b *Buffer) ReadUint16LE() uint16
- func (b *Buffer) ReadUint32BE() uint32
- func (b *Buffer) ReadUint32LE() uint32
- func (b *Buffer) ReadUint64BE() uint64
- func (b *Buffer) ReadUint64LE() uint64
- func (b *Buffer) ReadUint8() uint8
- func (b *Buffer) ReadVarInt() (int64, int)
- func (b *Buffer) ReadVarUint() (uint64, int)
- func (b *Buffer) Seal() []byte
- func (b *Buffer) Seek(offset int64, relative bool)
- func (b *Buffer) UnsafeSeek(offset int64, relative bool)
- func (b *Buffer) Update()
- func (b *Buffer) WriteByte(data byte)
- func (b *Buffer) WriteBytes(data []byte)
- func (b *Buffer) WriteFloat32BE(data float32)
- func (b *Buffer) WriteFloat32LE(data float32)
- func (b *Buffer) WriteFloat64BE(data float64)
- func (b *Buffer) WriteFloat64LE(data float64)
- func (b *Buffer) WriteInt16BE(data int16)
- func (b *Buffer) WriteInt16LE(data int16)
- func (b *Buffer) WriteInt32BE(data int32)
- func (b *Buffer) WriteInt32LE(data int32)
- func (b *Buffer) WriteInt64BE(data int64)
- func (b *Buffer) WriteInt64LE(data int64)
- func (b *Buffer) WriteInt8(data int8)
- func (b *Buffer) WriteString(str *string)
- func (b *Buffer) WriteUint16BE(data uint16)
- func (b *Buffer) WriteUint16LE(data uint16)
- func (b *Buffer) WriteUint32BE(data uint32)
- func (b *Buffer) WriteUint32LE(data uint32)
- func (b *Buffer) WriteUint64BE(data uint64)
- func (b *Buffer) WriteUint64LE(data uint64)
- func (b *Buffer) WriteUint8(data uint8)
- func (b *Buffer) WriteVarInt(x int64) int64
- func (b *Buffer) WriteVarUint(x uint64) int64
- type BufferError
Constants ¶
This section is empty.
Variables ¶
var ( // BufferOverreadError represents an instance in which a read // attempted to read past the buffer itself BufferSeekError = BufferError{ // contains filtered or unexported fields } // BufferOverreadError represents an instance in which a read // attempted to read past the buffer itself BufferOverreadError = BufferError{ // contains filtered or unexported fields } // BufferUnderreadError represents an instance in which a read // attempted to read before the buffer itself BufferUnderreadError = BufferError{ // contains filtered or unexported fields } // BufferOverwriteError represents an instance in which a write // attempted to write past the buffer itself BufferOverwriteError = BufferError{ // contains filtered or unexported fields } // BufferUnderwriteError represents an instance in which a write // attempted to write before the buffer itself BufferUnderwriteError = BufferError{ // contains filtered or unexported fields } // BufferInvalidByteCountError represents an instance in which an // invalid byte count was passed to one of the buffer's methods BufferInvalidByteCountError = BufferError{ // contains filtered or unexported fields } // BytesBufNegativeReadError represents an instance in which a // reader returned a negative count from its Read method BytesBufNegativeReadError = BufferError{ // contains filtered or unexported fields } )
Functions ¶
func ByteLenVarUint ¶
*****************
- Varint Routine * *****************
ByteLenVarUint get size of varuint number
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer a buffer instance
func (*Buffer) ReadFloat32BE ¶
func (*Buffer) ReadFloat32LE ¶
func (*Buffer) ReadFloat64BE ¶
func (*Buffer) ReadFloat64LE ¶
func (*Buffer) ReadInt16BE ¶
func (*Buffer) ReadInt16LE ¶
func (*Buffer) ReadInt32BE ¶
func (*Buffer) ReadInt32LE ¶
func (*Buffer) ReadInt64BE ¶
func (*Buffer) ReadInt64LE ¶
func (*Buffer) ReadString ¶
ReadString reads packed string from the buffer at the current offset and moves the offset forward the amount of bytes read. Retrurns string instance
func (*Buffer) ReadStringPtr ¶
ReadStringPtr reads packed string from the buffer at the current offset and moves the offset forward the amount of bytes read Retrurns pointer of string instance
func (*Buffer) ReadUint16BE ¶
func (*Buffer) ReadUint16LE ¶
func (*Buffer) ReadUint32BE ¶
func (*Buffer) ReadUint32LE ¶
func (*Buffer) ReadUint64BE ¶
func (*Buffer) ReadUint64LE ¶
func (*Buffer) ReadVarInt ¶
ReadVarInt reads a varuint from the buffer at the current offset and moves the offset forward the amount of bytes read
func (*Buffer) ReadVarUint ¶
ReadVarUint reads a varuint from the buffer at the current offset and moves the offset forward the amount of bytes read
func (*Buffer) UnsafeSeek ¶
UnsafeSeek seeks to position off of the buffer without boundary checking
func (*Buffer) WriteByte ¶
WriteByte writes byte to the buffer at the current offset and moves forward the amount of bytes written nolint
func (*Buffer) WriteBytes ¶
WriteBytes writes bytes to the buffer at the current offset and moves forward the amount of bytes written
func (*Buffer) WriteFloat32BE ¶
func (*Buffer) WriteFloat32LE ¶
func (*Buffer) WriteFloat64BE ¶
func (*Buffer) WriteFloat64LE ¶
func (*Buffer) WriteInt16BE ¶
func (*Buffer) WriteInt16LE ¶
func (*Buffer) WriteInt32BE ¶
func (*Buffer) WriteInt32LE ¶
func (*Buffer) WriteInt64BE ¶
func (*Buffer) WriteInt64LE ¶
func (*Buffer) WriteString ¶
func (*Buffer) WriteUint16BE ¶
func (*Buffer) WriteUint16LE ¶
func (*Buffer) WriteUint32BE ¶
func (*Buffer) WriteUint32LE ¶
func (*Buffer) WriteUint64BE ¶
func (*Buffer) WriteUint64LE ¶
func (*Buffer) WriteUint8 ¶
func (*Buffer) WriteVarInt ¶
WriteVarInt write varint to the buffer at the current offset and moves the offset forward the amount of bytes written. Returns number of bytes written
func (*Buffer) WriteVarUint ¶
WriteVarUint write varuint to the buffer at the current offset and moves the offset forward the amount of bytes written. Returns number of bytes written
type BufferError ¶
type BufferError struct {
// contains filtered or unexported fields
}
Error implements custom error in buffer