Documentation
¶
Overview ¶
注意binary模块默认使用LittleEndian进行编码
Index ¶
- func Decode(b []byte, values ...interface{}) error
- func DecodeToBool(b []byte) bool
- func DecodeToFloat32(b []byte) float32
- func DecodeToFloat64(b []byte) float64
- func DecodeToInt(b []byte) int
- func DecodeToInt8(b []byte) int8
- func DecodeToInt16(b []byte) int16
- func DecodeToInt32(b []byte) int32
- func DecodeToInt64(b []byte) int64
- func DecodeToString(b []byte) string
- func DecodeToUint(b []byte) uint
- func DecodeToUint8(b []byte) uint8
- func DecodeToUint16(b []byte) uint16
- func DecodeToUint32(b []byte) uint32
- func DecodeToUint64(b []byte) uint64
- func Encode(values ...interface{}) []byte
- func EncodeBool(b bool) []byte
- func EncodeByLength(length int, values ...interface{}) []byte
- func EncodeFloat32(f float32) []byte
- func EncodeFloat64(f float64) []byte
- func EncodeInt(i int) []byte
- func EncodeInt8(i int8) []byte
- func EncodeInt16(i int16) []byte
- func EncodeInt32(i int32) []byte
- func EncodeInt64(i int64) []byte
- func EncodeString(s string) []byte
- func EncodeUint(i uint) []byte
- func EncodeUint8(i uint8) []byte
- func EncodeUint16(i uint16) []byte
- func EncodeUint32(i uint32) []byte
- func EncodeUint64(i uint64) []byte
- func LeDecode(b []byte, values ...interface{}) error
- func LeDecodeToBool(b []byte) bool
- func LeDecodeToFloat32(b []byte) float32
- func LeDecodeToFloat64(b []byte) float64
- func LeDecodeToInt(b []byte) int
- func LeDecodeToInt8(b []byte) int8
- func LeDecodeToInt16(b []byte) int16
- func LeDecodeToInt32(b []byte) int32
- func LeDecodeToInt64(b []byte) int64
- func LeDecodeToString(b []byte) string
- func LeDecodeToUint(b []byte) uint
- func LeDecodeToUint8(b []byte) uint8
- func LeDecodeToUint16(b []byte) uint16
- func LeDecodeToUint32(b []byte) uint32
- func LeDecodeToUint64(b []byte) uint64
- func LeEncode(values ...interface{}) []byte
- func LeEncodeBool(b bool) []byte
- func LeEncodeByLength(length int, values ...interface{}) []byte
- func LeEncodeFloat32(f float32) []byte
- func LeEncodeFloat64(f float64) []byte
- func LeEncodeInt(i int) []byte
- func LeEncodeInt8(i int8) []byte
- func LeEncodeInt16(i int16) []byte
- func LeEncodeInt32(i int32) []byte
- func LeEncodeInt64(i int64) []byte
- func LeEncodeString(s string) []byte
- func LeEncodeUint(i uint) []byte
- func LeEncodeUint8(i uint8) []byte
- func LeEncodeUint16(i uint16) []byte
- func LeEncodeUint32(i uint32) []byte
- func LeEncodeUint64(i uint64) []byte
- func LeFillUpSize(b []byte, l int) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeToBool ¶
func DecodeToFloat32 ¶
func DecodeToFloat64 ¶
func DecodeToInt ¶
func DecodeToInt8 ¶
func DecodeToInt16 ¶
func DecodeToInt32 ¶
func DecodeToInt64 ¶
func DecodeToString ¶
func DecodeToUint ¶
func DecodeToUint8 ¶
func DecodeToUint16 ¶
func DecodeToUint32 ¶
func DecodeToUint64 ¶
func EncodeBool ¶
func EncodeByLength ¶
func EncodeFloat32 ¶
func EncodeFloat64 ¶
func EncodeInt8 ¶
func EncodeInt16 ¶
func EncodeInt32 ¶
func EncodeInt64 ¶
func EncodeString ¶
func EncodeUint ¶
func EncodeUint8 ¶
func EncodeUint16 ¶
func EncodeUint32 ¶
func EncodeUint64 ¶
func LeDecodeToFloat32 ¶
func LeDecodeToFloat64 ¶
func LeDecodeToInt8 ¶
func LeDecodeToInt16 ¶
func LeDecodeToInt32 ¶
func LeDecodeToInt64 ¶
func LeDecodeToString ¶
func LeDecodeToUint ¶
func LeDecodeToUint8 ¶
func LeDecodeToUint16 ¶
func LeDecodeToUint32 ¶
func LeDecodeToUint64 ¶
func LeEncode ¶
func LeEncode(values ...interface{}) []byte
针对基本类型进行二进制打包 其他未知类型使用 fmt.Sprintf("%v", value) 转换为字符串之后处理
func LeEncodeBool ¶
func LeEncodeByLength ¶
如果转换的二进制长度超过指定长度,那么进行截断处理
func LeEncodeFloat32 ¶
func LeEncodeFloat64 ¶
func LeEncodeInt ¶
func LeEncodeInt8 ¶
func LeEncodeInt16 ¶
func LeEncodeInt32 ¶
func LeEncodeInt64 ¶
func LeEncodeString ¶
func LeEncodeUint ¶
func LeEncodeUint8 ¶
func LeEncodeUint16 ¶
func LeEncodeUint32 ¶
func LeEncodeUint64 ¶
func LeFillUpSize ¶
当b位数不够时,进行高位补0。 注意这里为了不影响原有输入参数,是采用的值复制设计。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.