func (c *boolSliceCodec) EncodeTo(e *binary.Encoder, rv reflect.Value) (err error) {
	l := rv.Len()
	e.WriteUvarint(uint64(l))
	if l > 0 {
		v := rv.Interface().(Bools)
		e.Write(boolsToBinary(&v))
	}
	return
}
Encode encodes a value into the encoder.
package nocopy
import (
	"reflect"
	"unsafe"
	"github.com/kelindar/binary"
)
type integerSliceCodec struct {
	sliceType reflect.Type
	sizeOfInt int
}
func (c *integerSliceCodec) EncodeTo(e *binary.Encoder, rv reflect.Value) (err error) {
	var out reflect.SliceHeader
	out.Data = rv.Pointer()
	out.Len = rv.Len() * c.sizeOfInt
	out.Cap = out.Len
	e.WriteUint64(uint64(rv.Len() * c.sizeOfInt))
	e.Write(*(*[]byte)(unsafe.Pointer(&out)))
	return
}
func (c *integerSliceCodec) DecodeTo(d *binary.Decoder, rv reflect.Value) (err error) {
	var l uint64
	var b []byte
	if l, err = d.ReadUint64(); err == nil && l > 0 {
		if b, err = d.Slice(int(l)); err == nil {
			out := (*reflect.SliceHeader)(unsafe.Pointer(rv.UnsafeAddr()))
			out.Data = (*reflect.SliceHeader)(unsafe.Pointer(&b)).Data
			out.Len = int(l) / c.sizeOfInt
			out.Cap = int(l) / c.sizeOfInt
		}
	}
	return
}
type byteSliceCodec struct{}
func (c *byteSliceCodec) EncodeTo(e *binary.Encoder, rv reflect.Value) (err error) {
	e.WriteUvarint(uint64(rv.Len()))
	e.Write(rv.Bytes())
	return
}
func (c *byteSliceCodec) DecodeTo(d *binary.Decoder, rv reflect.Value) (err error) {
	var l uint64
	var b []byte
	if l, err = d.ReadUvarint(); err == nil && l > 0 {
		if b, err = d.Slice(int(l)); err == nil {
			rv.SetBytes(b)
		}
	}
	return
}
type stringCodec struct{}
func (c *stringCodec) EncodeTo(e *binary.Encoder, rv reflect.Value) error {
	v := rv.String()
	e.WriteUvarint(uint64(len(v)))
	e.Write(binary.ToBytes(v))
	return nil
}
func (c *stringCodec) DecodeTo(d *binary.Decoder, rv reflect.Value) (err error) {
	var l uint64
	var v []byte
	if l, err = d.ReadUvarint(); err == nil {
		if v, err = d.Slice(int(l)); err == nil {
			rv.SetString(binary.ToString(&v))
		}
	}
	return
}
type boolSliceCodec struct{}