func ReadBoolBytes(b []byte) (bool, []byte, error) {
	if len(b) < 1 {
		return false, b, ErrShortBytes
	}
	switch b[0] {
	case mtrue:
		return true, b[1:], nil
	case mfalse:
		return false, b[1:], nil
	case mnil:
		return false, b[1:], nil
	default:
		return false, b, badPrefix(BoolType, b[0])
	}
}
ReadBoolBytes tries to read a float64
from 'b' and return the value and the remaining bytes.
Possible errors:
- ErrShortBytes (too few bytes)
- TypeError{} (not a bool)
package msgp
import (
	"encoding/binary"
	"math"
	"time"
)
var big = binary.BigEndian
func NextType(b []byte) Type {
	if len(b) == 0 {
		return InvalidType
	}
	spec := sizes[b[0]]
	t := spec.typ
	if t == ExtensionType && len(b) > int(spec.size) {
		var tp int8
		if spec.extra == constsize {
			tp = int8(b[1])
		} else {
			tp = int8(b[spec.size-1])
		}
		switch tp {
		case TimeExtension:
			return TimeType
		case Complex128Extension:
			return Complex128Type
		case Complex64Extension:
			return Complex64Type
		default:
			return ExtensionType
		}
	}
	return t
}
func IsNil(b []byte) bool {
	if len(b) != 0 && b[0] == mnil {
		return true
	}
	return false
}
type Raw []byte
func (Raw) CanMarshalMsg(z interface{}) bool {
	_, ok := (z).(Raw)
	if !ok {
		_, ok = (z).(*Raw)
	}
	return ok
}
func (r Raw) MarshalMsg(b []byte) []byte {
	i := len(r)
	if i == 0 {
		return AppendNil(b)
	}
	o, l := ensure(b, i)
	copy(o[l:], []byte(r))
	return o
}
func (*Raw) CanUnmarshalMsg(z interface{}) bool {
	_, ok := (z).(*Raw)
	return ok
}
func (r *Raw) UnmarshalMsg(b []byte) ([]byte, error) {
	l := len(b)
	out, err := Skip(b)
	if err != nil {
		return b, err
	}
	rlen := l - len(out)
	if IsNil(b[:rlen]) {
		rlen = 0
	}
	if cap(*r) < rlen {
		*r = make(Raw, rlen)
	} else {
		*r = (*r)[0:rlen]
	}
	copy(*r, b[:rlen])
	return out, nil
}
func (r Raw) Msgsize() int {
	l := len(r)
	if l == 0 {
		return 1  
	}
	return l
}
func (r *Raw) MsgIsZero() bool {
	return len(*r) == 0
}
func ReadMapHeaderBytes(b []byte) (sz int, isnil bool, o []byte, err error) {
	l := len(b)
	if l < 1 {
		err = ErrShortBytes
		return
	}
	lead := b[0]
	if isfixmap(lead) {
		sz = int(rfixmap(lead))
		o = b[1:]
		return
	}
	switch lead {
	case mnil:
		sz = 0
		o = b[1:]
		isnil = true
		return
	case mmap16:
		if l < 3 {
			err = ErrShortBytes
			return
		}
		sz = int(big.Uint16(b[1:]))
		o = b[3:]
		return
	case mmap32:
		if l < 5 {
			err = ErrShortBytes
			return
		}
		sz, err = u32int(big.Uint32(b[1:]))
		if err != nil {
			return
		}
		o = b[5:]
		return
	default:
		o = b
		err = badPrefix(MapType, lead)
		return
	}
}
func ReadMapKeyZC(b []byte) ([]byte, []byte, error) {
	o, x, err := ReadStringZC(b)
	if err != nil {
		if tperr, ok := err.(TypeError); ok && tperr.Encoded == BinType {
			return ReadBytesZC(b)
		}
		return nil, b, err
	}
	return o, x, nil
}
func ReadArrayHeaderBytes(b []byte) (sz int, isnil bool, o []byte, err error) {
	return readArrayHeaderBytes(b, true)
}
func readArrayHeaderBytes(b []byte, flattenMap bool) (sz int, isnil bool, o []byte, err error) {
	if len(b) < 1 {
		return 0, false, nil, ErrShortBytes
	}
	lead := b[0]
	if isfixarray(lead) {
		sz = int(rfixarray(lead))
		o = b[1:]
		return
	}
	if flattenMap && isfixmap(lead) {
		sz = 2 * int(rfixmap(lead))
		o = b[1:]
		return
	}
	switch lead {
	case mnil:
		sz = 0
		o = b[1:]
		isnil = true
		return
	case marray16:
		if len(b) < 3 {
			err = ErrShortBytes
			return
		}
		sz = int(big.Uint16(b[1:]))
		o = b[3:]
		return
	case marray32:
		if len(b) < 5 {
			err = ErrShortBytes
			return
		}
		sz, err = u32int(big.Uint32(b[1:]))
		if err != nil {
			return
		}
		o = b[5:]
		return
	case mmap16:
		if flattenMap {
			if len(b) < 3 {
				err = ErrShortBytes
				return
			}
			sz = 2 * int(big.Uint16(b[1:]))
			o = b[3:]
			return
		}
	case mmap32:
		if flattenMap {
			if len(b) < 5 {
				err = ErrShortBytes
				return
			}
			u64sz := 2 * uint64(big.Uint32(b[1:]))
			sz, err = u64int(u64sz)
			if err != nil {
				return
			}
			o = b[5:]
			return
		}
	}
	o = b
	err = badPrefix(ArrayType, lead)
	return
}
func ReadNilBytes(b []byte) ([]byte, error) {
	if len(b) < 1 {
		return nil, ErrShortBytes
	}
	if b[0] != mnil {
		return b, badPrefix(NilType, b[0])
	}
	return b[1:], nil
}
func ReadFloat64Bytes(b []byte) (f float64, o []byte, err error) {
	if len(b) < 9 {
		if len(b) >= 5 && b[0] == mfloat32 {
			var tf float32
			tf, o, err = ReadFloat32Bytes(b)
			f = float64(tf)
			return
		}
		if b[0] == mnil {
			o = b[1:]
			return
		}
		err = ErrShortBytes
		return
	}
	if b[0] != mfloat64 {
		if b[0] == mfloat32 {
			var tf float32
			tf, o, err = ReadFloat32Bytes(b)
			f = float64(tf)
			return
		}
		err = badPrefix(Float64Type, b[0])
		return
	}
	f = math.Float64frombits(getMuint64(b))
	o = b[9:]
	return
}
func ReadFloat32Bytes(b []byte) (f float32, o []byte, err error) {
	if len(b) < 1 {
		err = ErrShortBytes
		return
	}
	if b[0] == mnil {
		o = b[1:]
		return
	}
	if b[0] != mfloat32 {
		err = TypeError{Method: Float32Type, Encoded: getType(b[0])}
		return
	}
	if len(b) < 5 {
		err = ErrShortBytes
		return
	}
	f = math.Float32frombits(getMuint32(b))
	o = b[5:]
	return
}