Documentation ¶
Index ¶
- Constants
- func ByteArrayNoZeroString(arr []byte) (rst string)
- func Gb2312ToUtf(text []byte) (result []byte, err error)
- func GbkToUtf(text []byte) (result []byte, err error)
- func ReadBigEndian(content []byte, target interface{}) (err error)
- func ReadConn(conn net.Conn, length uint32) (buf []byte, err error)
- func ReadConnMaxLength(conn net.Conn, length uint32, maxLength uint32) (buf []byte, err error)
- func ReadLittleEndian(content []byte, target interface{}) (err error)
- func UtfToGb2312(text []byte) (result []byte, err error)
- func UtfToGbk(text []byte) (result []byte, err error)
- func WriteBigEndian(content interface{}) (result []byte, err error)
- func WriteLittleEndian(content interface{}) (result []byte, err error)
Constants ¶
View Source
const DefaultMaxLength = uint32(1024 * 1024 * 20)
默认最大长度20M
Variables ¶
This section is empty.
Functions ¶
func ByteArrayNoZeroString ¶
定长数组去掉多余的0后转字符串,先将定长数组转为切片后传入
func ReadBigEndian ¶
按大端序解析[]byte到结构体
func ReadConnMaxLength ¶
从连接中读取数据,判断最大长度
func ReadLittleEndian ¶
按小端序解析[]byte到结构体
func WriteLittleEndian ¶
将数据转换为小端序
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.