gprotocol

package
v0.0.0-...-a7e2b7f Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreePack

func FreePack(buf []byte)

func Read2Bytes

func Read2Bytes(b *[]byte) (s []byte)

func Read2BytesUsafe

func Read2BytesUsafe(b *[]byte) (s []byte)

警告,直接返回的 b 的切片,如果b会被修改请自己拷贝一份副本。

func Read2String

func Read2String(b *[]byte) (s string)

func ReadInt32

func ReadInt32(b *[]byte) int32

func ReadInt64

func ReadInt64(b *[]byte) int64

func ReadPType

func ReadPType(r io.Reader) (byte, error)

func ReadPack

func ReadPack(r io.Reader) ([]byte, error)

func ReadPackLength

func ReadPackLength(r io.Reader) (uint16, error)

func ReadPackTypeAndLength

func ReadPackTypeAndLength(r io.Reader) (byte, uint16, error)

func ReadUint16

func ReadUint16(b *[]byte) uint16

func ReadUint32

func ReadUint32(b *[]byte) uint32

func ReadUint64

func ReadUint64(b *[]byte) uint64

func ReadUint8

func ReadUint8(b *[]byte) uint8

注意,长度不足时会直接 panic: runtime error: index out of range

func Write2Bytes

func Write2Bytes(b *[]byte, v []byte)

func Write2String

func Write2String(b *[]byte, v string)

func WriteInt32

func WriteInt32(b *[]byte, v int32)

func WriteInt64

func WriteInt64(b *[]byte, v int64)

func WritePackLength

func WritePackLength(pack []byte)

func WriteUint16

func WriteUint16(b *[]byte, v uint16)

func WriteUint32

func WriteUint32(b *[]byte, v uint32)

func WriteUint64

func WriteUint64(b *[]byte, v uint64)

func WriteUint8

func WriteUint8(b *[]byte, v uint8)

Types

This section is empty.

Jump to

Keyboard shortcuts

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