Documentation
¶
Index ¶
- func FromBytesWithLength32(b []byte) (bb []byte)
- func FromBytesWithLength64(b []byte) (bb []byte)
- func FromFloat32(value float32) (b []byte)
- func FromFloat64(value float64) (b []byte)
- func FromInt16(value int16) (b []byte)
- func FromInt32(value int32) (b []byte)
- func FromInt64(value int64) (b []byte)
- func FromInt8(value int8) (b []byte)
- func FromString(value string) (b []byte)
- func FromStringWithLength32(value string) (b []byte)
- func FromStringWithLength64(value string) (b []byte)
- func FromUint16(value uint16) (b []byte)
- func FromUint32(value uint32) (b []byte)
- func FromUint64(value uint64) (b []byte)
- func FromUint8(value uint8) (b []byte)
- func NewBuffer(b ...byte) *bytes.Buffer
- func ReadBytesWithLength32(r io.Reader) (b []byte, err error)
- func ReadBytesWithLength64(r io.Reader) (b []byte, err error)
- func ReadFloat32(r io.Reader) (v float32, err error)
- func ReadFloat64(r io.Reader) (v float64, err error)
- func ReadInt16(r io.Reader) (v int16, err error)
- func ReadInt32(r io.Reader) (v int32, err error)
- func ReadInt64(r io.Reader) (v int64, err error)
- func ReadInt8(r io.Reader) (v int8, err error)
- func ReadNBytes(r io.Reader, n int) (b []byte, err error)
- func ReadStringWithLength32(r io.Reader) (value string, err error)
- func ReadStringWithLength64(r io.Reader) (value string, err error)
- func ReadUint16(r io.Reader) (v uint16, err error)
- func ReadUint32(r io.Reader) (v uint32, err error)
- func ReadUint64(r io.Reader) (v uint64, err error)
- func ReadUint8(r io.Reader) (v uint8, err error)
- func ToFloat32(b []byte) (value float32)
- func ToFloat64(b []byte) (value float64)
- func ToInt16(b []byte) (value int16)
- func ToInt32(b []byte) (value int32)
- func ToInt64(b []byte) (value int64)
- func ToInt8(b []byte) (value int8)
- func ToUint16(b []byte) (value uint16)
- func ToUint32(b []byte) (value uint32)
- func ToUint64(b []byte) (value uint64)
- func ToUint8(b []byte) (value uint8)
- type Serializable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromBytesWithLength32 ¶
FromBytesWithLength32 the data to the writer after the length of the data The length will store with int32
func FromBytesWithLength64 ¶
FromBytesWithLength64 the data to the writer after the length of the data The length will store with int64
func FromFloat32 ¶
FromFloat32 transfer from float32 to []byte
func FromFloat64 ¶
FromFloat64 transfer from float64 to []byte
func FromString ¶
FromString transfer from string to []byte
func FromStringWithLength32 ¶
FromStringWithLength32 transfer string to []byte with 32-bit length
func FromStringWithLength64 ¶
FromStringWithLength64 transfer string to []byte with 64-bit length
func FromUint16 ¶
FromUint16 transfer from uint16 to []byte
func FromUint32 ¶
FromUint32 transfer from uint32 to []byte
func FromUint64 ¶
FromUint64 transfer from uint64 to []byte
func ReadBytesWithLength32 ¶
ReadBytesWithLength32 read an int32 length first, and then read the data with length
func ReadBytesWithLength64 ¶
ReadBytesWithLength64 read an int64 length first, and then read the data with length ONLY USE IN 64-BIT SYSTEM
func ReadFloat32 ¶
ReadFloat32 read a float32 value
func ReadFloat64 ¶
ReadFloat64 read a float64 value
func ReadNBytes ¶
ReadNBytes read n bytes from a io.Reader
func ReadStringWithLength32 ¶
ReadStringWithLength32 read string with 32-bit length from reader
func ReadStringWithLength64 ¶
ReadStringWithLength64 read string with 64-bit length from reader
func ReadUint16 ¶
ReadUint16 read an uint16 value
func ReadUint32 ¶
ReadUint32 read an uint32 value
func ReadUint64 ¶
ReadUint64 read an uint64 value
Types ¶
type Serializable ¶
type Serializable interface {
ToBytes() []byte
}
Serializable could be serialization type