buffer

package
v1.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2025 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INT8_SIZE     int32 = 1
	INT16_SIZE    int32 = 2
	INT32_SIZE    int32 = 4
	INT64_SIZE    int32 = 8
	STRING_PREFIX int32 = 2
	BYTES_PREFIX  int32 = 2
)
View Source
const (
	Int8Size     int32 = 1
	Int16Size    int32 = 2
	Int32Size    int32 = 4
	Int64Size    int32 = 8
	StringPrefix int32 = 2
	BytesPrefix  int32 = 4
)

Variables

This section is empty.

Functions

func ByteToInt16

func ByteToInt16(buf []byte) (ret int16)

func ByteToInt32

func ByteToInt32(buf []byte) (ret int32)

func ByteToInt64

func ByteToInt64(buf []byte) (ret int64)

func Int16ToByte

func Int16ToByte(v int16) (buf []byte)

func Int32ToByte

func Int32ToByte(v int32) (buf []byte)

func Int64ToByte

func Int64ToByte(v int64) (buf []byte)

Types

type ProtocolBuffer

type ProtocolBuffer struct {
	// contains filtered or unexported fields
}

func FromBytes

func FromBytes(v []byte) (ret *ProtocolBuffer)

func (*ProtocolBuffer) GetBodyContent

func (p *ProtocolBuffer) GetBodyContent() (ret []byte)

TOFIX

func (*ProtocolBuffer) GetContent

func (p *ProtocolBuffer) GetContent() (ret []byte)

func (*ProtocolBuffer) GetReadIndex

func (p *ProtocolBuffer) GetReadIndex() (ret int32)

func (*ProtocolBuffer) GetWriteIndex

func (p *ProtocolBuffer) GetWriteIndex() (ret int32)

func (*ProtocolBuffer) ReadBytes

func (p *ProtocolBuffer) ReadBytes() (ret []byte)

func (*ProtocolBuffer) ReadBytesWithIndex

func (p *ProtocolBuffer) ReadBytesWithIndex(index int32) (ret []byte)

func (*ProtocolBuffer) ReadBytesWithOutLength

func (p *ProtocolBuffer) ReadBytesWithOutLength() (ret []byte)

func (*ProtocolBuffer) ReadInt16

func (p *ProtocolBuffer) ReadInt16() (ret int16)

func (*ProtocolBuffer) ReadInt16WithIndex

func (p *ProtocolBuffer) ReadInt16WithIndex(index int32) (ret int16)

func (*ProtocolBuffer) ReadInt32

func (p *ProtocolBuffer) ReadInt32() (ret int32)

func (*ProtocolBuffer) ReadInt32WithIndex

func (p *ProtocolBuffer) ReadInt32WithIndex(index int32) (ret int32)

func (*ProtocolBuffer) ReadInt64

func (p *ProtocolBuffer) ReadInt64() (ret int64)

func (*ProtocolBuffer) ReadInt64WithIndex

func (p *ProtocolBuffer) ReadInt64WithIndex(index int32) (ret int64)

func (*ProtocolBuffer) ReadInt8

func (p *ProtocolBuffer) ReadInt8() (ret int8)

func (*ProtocolBuffer) ReadInt8WithIndex

func (p *ProtocolBuffer) ReadInt8WithIndex(index int32) (ret int8)

func (*ProtocolBuffer) ReadString

func (p *ProtocolBuffer) ReadString() (ret string)

func (*ProtocolBuffer) ReadStringWithIndex

func (p *ProtocolBuffer) ReadStringWithIndex(index int32) (ret string)

func (*ProtocolBuffer) ReadStringWithOutLength

func (p *ProtocolBuffer) ReadStringWithOutLength() (ret string)

func (*ProtocolBuffer) ReadUInt8

func (p *ProtocolBuffer) ReadUInt8() (ret uint8)

func (*ProtocolBuffer) ReadUInt8WithIndex

func (p *ProtocolBuffer) ReadUInt8WithIndex(index int32) (ret uint8)

func (*ProtocolBuffer) ToBytes

func (p *ProtocolBuffer) ToBytes() (ret []byte)

func (*ProtocolBuffer) WriteBytes

func (p *ProtocolBuffer) WriteBytes(v []byte)

func (*ProtocolBuffer) WriteBytesWithIndex

func (p *ProtocolBuffer) WriteBytesWithIndex(index int32, v []byte)

func (*ProtocolBuffer) WriteBytesWithOutLength

func (p *ProtocolBuffer) WriteBytesWithOutLength(v []byte)

func (*ProtocolBuffer) WriteInt16

func (p *ProtocolBuffer) WriteInt16(v int16)

func (*ProtocolBuffer) WriteInt16WithIndex

func (p *ProtocolBuffer) WriteInt16WithIndex(index int32, v int16)

func (*ProtocolBuffer) WriteInt32

func (p *ProtocolBuffer) WriteInt32(v int32)

func (*ProtocolBuffer) WriteInt32WithIndex

func (p *ProtocolBuffer) WriteInt32WithIndex(index int32, v int32)

func (*ProtocolBuffer) WriteInt64

func (p *ProtocolBuffer) WriteInt64(v int64)

func (*ProtocolBuffer) WriteInt64WithIndex

func (p *ProtocolBuffer) WriteInt64WithIndex(index int32, v int64)

func (*ProtocolBuffer) WriteInt8

func (p *ProtocolBuffer) WriteInt8(v int8)

func (*ProtocolBuffer) WriteInt8WithIndex

func (p *ProtocolBuffer) WriteInt8WithIndex(index int32, v int8)

func (*ProtocolBuffer) WriteString

func (p *ProtocolBuffer) WriteString(v string)

func (*ProtocolBuffer) WriteStringWithIndex

func (p *ProtocolBuffer) WriteStringWithIndex(index int32, v string)

func (*ProtocolBuffer) WriteUInt8

func (p *ProtocolBuffer) WriteUInt8(v uint8)

func (*ProtocolBuffer) WriteUInt8WithIndex

func (p *ProtocolBuffer) WriteUInt8WithIndex(index int32, v uint8)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL