func (u *Unpacker) FetchString(n uint64, s *string) *Unpacker {
	return u.errFilter(func() {
		*s, u.err = u.ShiftString(n)
	})
}
FetchString read n bytes, convert it to string and set t to s.
package binpacker
import (
	"encoding/binary"
	"fmt"
	"io"
	"math"
	"unsafe"
)
type Unpacker struct {
	reader io.Reader
	endian binary.ByteOrder
	err    error
}
func NewUnpacker(endian binary.ByteOrder, reader io.Reader) *Unpacker {
	return &Unpacker{
		reader: reader,
		endian: endian,
	}
}
func (u *Unpacker) Error() error {
	return u.err
}
func (u *Unpacker) ShiftByte() (byte, error) {
	buffer := make([]byte, 1)
	_, err := io.ReadFull(u.reader, buffer)
	return buffer[0], err
}
func (u *Unpacker) FetchByte(b *byte) *Unpacker {
	return u.errFilter(func() {
		*b, u.err = u.ShiftByte()
	})
}
func (u *Unpacker) ShiftBytes(_n uint64) ([]byte, error) {
	buf := make([]byte, _n)
	_, err := io.ReadFull(u.reader, buf)
	return buf, err
}
func (u *Unpacker) FetchBytes(n uint64, bytes *[]byte) *Unpacker {
	return u.errFilter(func() {
		*bytes, u.err = u.ShiftBytes(n)
	})
}
func (u *Unpacker) ShiftUint8() (uint8, error) {
	buffer := make([]byte, 1)
	_, err := io.ReadFull(u.reader, buffer)
	return buffer[0], err
}
func (u *Unpacker) FetchUint8(i *uint8) *Unpacker {
	return u.errFilter(func() {
		*i, u.err = u.ShiftUint8()
	})
}
func (u *Unpacker) ShiftUint16() (uint16, error) {
	buffer := make([]byte, 2)
	if _, err := io.ReadFull(u.reader, buffer); err != nil {
		return 0, err
	}
	return u.endian.Uint16(buffer), nil
}
func (u *Unpacker) FetchUint16(i *uint16) *Unpacker {
	return u.errFilter(func() {
		*i, u.err = u.ShiftUint16()
	})
}
func (u *Unpacker) ShiftInt16() (int16, error) {
	i, err := u.ShiftUint16()
	return int16(i), err
}
func (u *Unpacker) FetchInt16(i *int16) *Unpacker {
	return u.FetchUint16((*uint16)(unsafe.Pointer(i)))
}
func (u *Unpacker) ShiftUint32() (uint32, error) {
	buffer := make([]byte, 4)
	if _, err := io.ReadFull(u.reader, buffer); err != nil {
		return 0, err
	}
	return u.endian.Uint32(buffer), nil
}
func (u *Unpacker) ShiftInt32() (int32, error) {
	i, err := u.ShiftUint32()
	return int32(i), err
}
func (u *Unpacker) FetchUint32(i *uint32) *Unpacker {
	return u.errFilter(func() {
		*i, u.err = u.ShiftUint32()
	})
}
func (u *Unpacker) FetchInt32(i *int32) *Unpacker {
	return u.FetchUint32((*uint32)(unsafe.Pointer(i)))
}
func (u *Unpacker) ShiftUint64() (uint64, error) {
	buffer := make([]byte, 8)
	if _, err := io.ReadFull(u.reader, buffer); err != nil {
		return 0, err
	}
	return u.endian.Uint64(buffer), nil
}
func (u *Unpacker) ShiftInt64() (int64, error) {
	i, err := u.ShiftUint64()
	return int64(i), err
}
func (u *Unpacker) FetchUint64(i *uint64) *Unpacker {
	return u.errFilter(func() {
		*i, u.err = u.ShiftUint64()
	})
}
func (u *Unpacker) FetchInt64(i *int64) *Unpacker {
	return u.FetchUint64((*uint64)(unsafe.Pointer(i)))
}
func (u *Unpacker) ShiftFloat32() (float32, error) {
	buffer := make([]byte, 4)
	if _, err := io.ReadFull(u.reader, buffer); err != nil {
		return 0, err
	}
	return math.Float32frombits(u.endian.Uint32(buffer)), nil
}
func (u *Unpacker) ShiftFloat64() (float64, error) {
	buffer := make([]byte, 8)
	if _, err := io.ReadFull(u.reader, buffer); err != nil {
		return 0, err
	}
	return math.Float64frombits(u.endian.Uint64(buffer)), nil
}
func (u *Unpacker) FetchFloat32(i *float32) *Unpacker {
	return u.errFilter(func() {
		*i, u.err = u.ShiftFloat32()
	})
}
func (u *Unpacker) FetchFloat64(i *float64) *Unpacker {
	return u.errFilter(func() {
		*i, u.err = u.ShiftFloat64()
	})
}
func (u *Unpacker) ShiftString(n uint64) (string, error) {
	buffer := make([]byte, n)
	if _, err := io.ReadFull(u.reader, buffer); err != nil {
		return "", err
	}
	return string(buffer), nil
}