func (e *Encoder) WriteFloat32(v float32) {
	e.WriteUint32(math.Float32bits(v))
}
WriteFloat32 a 32-bit floating point number
package binary
import (
	"bytes"
	"encoding/binary"
	"io"
	"math"
	"reflect"
	"sync"
)
var encoders = &sync.Pool{New: func() interface{} {
	return &Encoder{
		schemas: make(map[reflect.Type]Codec),
	}
}}
func Marshal(v interface{}) (output []byte, err error) {
	var buffer bytes.Buffer
	buffer.Grow(64)
	if err = MarshalTo(v, &buffer); err == nil {
		output = buffer.Bytes()
	}
	return
}
func MarshalTo(v interface{}, dst io.Writer) (err error) {
	e := encoders.Get().(*Encoder)
	e.Reset(dst)
	err = e.Encode(v)
	encoders.Put(e)
	return
}
type Encoder struct {
	scratch [10]byte
	schemas map[reflect.Type]Codec
	out     io.Writer
	err     error
}
func NewEncoder(out io.Writer) *Encoder {
	return &Encoder{
		out:     out,
		schemas: make(map[reflect.Type]Codec),
	}
}
func (e *Encoder) Reset(out io.Writer) {
	e.out = out
	e.err = nil
}
func (e *Encoder) Buffer() io.Writer {
	return e.out
}
func (e *Encoder) Encode(v interface{}) (err error) {
	rv := reflect.Indirect(reflect.ValueOf(v))
	var c Codec
	if c, err = scanToCache(rv.Type(), e.schemas); err != nil {
		return
	}
	if err = c.EncodeTo(e, rv); err == nil {
		err = e.err
	}
	return
}
func (e *Encoder) Write(p []byte) {
	if e.err == nil {
		_, e.err = e.out.Write(p)
	}
}
func (e *Encoder) WriteVarint(v int64) {
	x := uint64(v) << 1
	if v < 0 {
		x = ^x
	}
	i := 0
	for x >= 0x80 {
		e.scratch[i] = byte(x) | 0x80
		x >>= 7
		i++
	}
	e.scratch[i] = byte(x)
	e.Write(e.scratch[:(i + 1)])
}
func (e *Encoder) WriteUvarint(x uint64) {
	i := 0
	for x >= 0x80 {
		e.scratch[i] = byte(x) | 0x80
		x >>= 7
		i++
	}
	e.scratch[i] = byte(x)
	e.Write(e.scratch[:(i + 1)])
}
func (e *Encoder) WriteUint16(v uint16) {
	e.scratch[0] = byte(v)
	e.scratch[1] = byte(v >> 8)
	e.Write(e.scratch[:2])
}
func (e *Encoder) WriteUint32(v uint32) {
	e.scratch[0] = byte(v)
	e.scratch[1] = byte(v >> 8)
	e.scratch[2] = byte(v >> 16)
	e.scratch[3] = byte(v >> 24)
	e.Write(e.scratch[:4])
}
func (e *Encoder) WriteUint64(v uint64) {
	e.scratch[0] = byte(v)
	e.scratch[1] = byte(v >> 8)
	e.scratch[2] = byte(v >> 16)
	e.scratch[3] = byte(v >> 24)
	e.scratch[4] = byte(v >> 32)
	e.scratch[5] = byte(v >> 40)
	e.scratch[6] = byte(v >> 48)
	e.scratch[7] = byte(v >> 56)
	e.Write(e.scratch[:8])
}