Documentation
¶
Index ¶
- func BytesToInt(b []byte) int
- func DecodeFixed16(b []byte) uint16
- func DecodeFixed32(b []byte) uint32
- func DecodeFixed32BE(b []byte) uint32
- func DecodeFixed64(b []byte) uint64
- func DecodeFixed64BE(b []byte) uint64
- func DecodeZigzag32(value uint32) int32
- func DecodeZigzag64(value uint64) int64
- func EncodeFixed16(value uint16) []byte
- func EncodeFixed32(value uint32) []byte
- func EncodeFixed32BE(value uint32) []byte
- func EncodeFixed64(value uint64) []byte
- func EncodeFixed64BE(value uint64) []byte
- func EncodeVarint32(n uint32) []byte
- func EncodeVarint64(n uint64) []byte
- func EncodeZigzag32(value int32) int32
- func EncodeZigzag64(value int64) int64
- func GetVarint32Ptr(buffer []byte) (uint32, uint, error)
- func GetVarint64Ptr(buffer []byte) (uint64, uint, error)
- func IntToBytes(n int) []byte
- func PutNByte(order binary.ByteOrder, b []byte, v uint64)
- func RandomBytes(len int, dst []byte) []byte
- func Uint16ToBytes(n uint16, order binary.ByteOrder) []byte
- func Uint32ToBytes(n uint32, order binary.ByteOrder) []byte
- func Uint64ToBytes(n uint64, order binary.ByteOrder) []byte
- func VarintLength(v uint64) int
- type LimitedPool
- type MemoryStream
- func (p *MemoryStream) Bytes() []byte
- func (p *MemoryStream) Len() uint
- func (p *MemoryStream) Read(len uint) ([]byte, error)
- func (p *MemoryStream) ReadInt32() (int32, error)
- func (p *MemoryStream) ReadInt64() (int64, error)
- func (p *MemoryStream) ReadString() (string, error)
- func (p *MemoryStream) Remains() uint
- func (p *MemoryStream) Write(b []byte) error
- func (p *MemoryStream) WriteInt32(value int32) error
- func (p *MemoryStream) WriteInt64(value int64) error
- func (p *MemoryStream) WriteString(value string) error
- type MemoryStreamv2
- func (p *MemoryStreamv2) Bytes() []byte
- func (p *MemoryStreamv2) Len() uint
- func (p *MemoryStreamv2) Read(length uint) ([]byte, error)
- func (p *MemoryStreamv2) ReadInt32() (int32, error)
- func (p *MemoryStreamv2) ReadInt64() (int64, error)
- func (p *MemoryStreamv2) ReadString() (string, error)
- func (p *MemoryStreamv2) ReadUInt32() (uint32, error)
- func (p *MemoryStreamv2) Remains() uint
- func (p *MemoryStreamv2) Write(b []byte) error
- func (p *MemoryStreamv2) WriteInt32(value int32)
- func (p *MemoryStreamv2) WriteInt64(value int64)
- func (p *MemoryStreamv2) WriteString(value string) error
- func (p *MemoryStreamv2) WriteUInt32(value uint32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeFixed16 ¶
func DecodeFixed32 ¶
func DecodeFixed32BE ¶
func DecodeFixed64 ¶
func DecodeFixed64BE ¶
func DecodeZigzag32 ¶
func DecodeZigzag64 ¶
func EncodeFixed16 ¶
func EncodeFixed32 ¶
func EncodeFixed32BE ¶
func EncodeFixed64 ¶
func EncodeFixed64BE ¶
func EncodeVarint32 ¶
func EncodeVarint64 ¶
func EncodeZigzag32 ¶
func EncodeZigzag64 ¶
func VarintLength ¶
Types ¶
type LimitedPool ¶
type LimitedPool struct {
// contains filtered or unexported fields
}
func NewLimitedPool ¶
func NewLimitedPool(minSize, maxSize int) *LimitedPool
func (*LimitedPool) Get ¶
func (p *LimitedPool) Get(size int) *[]byte
func (*LimitedPool) Put ¶
func (p *LimitedPool) Put(b *[]byte)
type MemoryStream ¶
type MemoryStream struct {
// contains filtered or unexported fields
}
func NewMemoryStream ¶
func NewMemoryStream(order binary.ByteOrder) MemoryStream
func (*MemoryStream) Bytes ¶
func (p *MemoryStream) Bytes() []byte
func (*MemoryStream) Len ¶
func (p *MemoryStream) Len() uint
func (*MemoryStream) ReadInt32 ¶
func (p *MemoryStream) ReadInt32() (int32, error)
func (*MemoryStream) ReadInt64 ¶
func (p *MemoryStream) ReadInt64() (int64, error)
func (*MemoryStream) ReadString ¶
func (p *MemoryStream) ReadString() (string, error)
func (*MemoryStream) Remains ¶
func (p *MemoryStream) Remains() uint
func (*MemoryStream) Write ¶
func (p *MemoryStream) Write(b []byte) error
func (*MemoryStream) WriteInt32 ¶
func (p *MemoryStream) WriteInt32(value int32) error
func (*MemoryStream) WriteInt64 ¶
func (p *MemoryStream) WriteInt64(value int64) error
func (*MemoryStream) WriteString ¶
func (p *MemoryStream) WriteString(value string) error
type MemoryStreamv2 ¶
type MemoryStreamv2 struct {
// contains filtered or unexported fields
}
func NewMemoryStreamv2 ¶
func NewMemoryStreamv2() MemoryStreamv2
func (*MemoryStreamv2) Bytes ¶
func (p *MemoryStreamv2) Bytes() []byte
func (*MemoryStreamv2) Len ¶
func (p *MemoryStreamv2) Len() uint
func (*MemoryStreamv2) ReadInt32 ¶
func (p *MemoryStreamv2) ReadInt32() (int32, error)
func (*MemoryStreamv2) ReadInt64 ¶
func (p *MemoryStreamv2) ReadInt64() (int64, error)
func (*MemoryStreamv2) ReadString ¶
func (p *MemoryStreamv2) ReadString() (string, error)
func (*MemoryStreamv2) ReadUInt32 ¶
func (p *MemoryStreamv2) ReadUInt32() (uint32, error)
func (*MemoryStreamv2) Remains ¶
func (p *MemoryStreamv2) Remains() uint
func (*MemoryStreamv2) Write ¶
func (p *MemoryStreamv2) Write(b []byte) error
func (*MemoryStreamv2) WriteInt32 ¶
func (p *MemoryStreamv2) WriteInt32(value int32)
func (*MemoryStreamv2) WriteInt64 ¶
func (p *MemoryStreamv2) WriteInt64(value int64)
func (*MemoryStreamv2) WriteString ¶
func (p *MemoryStreamv2) WriteString(value string) error
func (*MemoryStreamv2) WriteUInt32 ¶
func (p *MemoryStreamv2) WriteUInt32(value uint32)
Click to show internal directories.
Click to hide internal directories.