func (bs *ByteStream) PutString(x string) {
	bs.PutUInt32(uint32(len(x)))
	bs.appendBytes([]byte(x))
}
PutString append string to ByteStream
package util
import (
	"encoding/binary"
	"unsafe"
)
const (
	uint16Size = 2
	uint32Size = 4
	uint64Size = 8
)
var currentEndianess = binary.LittleEndian
func GetByteOrder() binary.ByteOrder {
	var bo binary.ByteOrder
	var x uint32 = 0x01020304
	switch *(*byte)(unsafe.Pointer(&x)) {
	case 0x01:
	case 0x04:
	}
	return bo
}
type ByteStream struct {
	buf []byte
	cur uint32
}
func (bs *ByteStream) Bytes() []byte {
	return bs.buf
}
func (bs *ByteStream) Size() int {
	return len(bs.buf)
}
func (bs *ByteStream) appendBytes(buf []byte) {
	bs.buf = append(bs.buf, buf...)
	bs.cur += uint32(len(buf))
}
func (bs *ByteStream) PutUInt16(x uint16) {
	b := make([]byte, uint16Size)
	currentEndianess.PutUint16(b, x)
	bs.appendBytes(b)
}
func (bs *ByteStream) PutUInt32(x uint32) {
	b := make([]byte, uint32Size)
	currentEndianess.PutUint32(b, x)
	bs.appendBytes(b)
}
func (bs *ByteStream) PutUInt64(x uint64) {
	b := make([]byte, uint64Size)
	currentEndianess.PutUint64(b, x)
	bs.appendBytes(b)
}