func NewReaderBuf(r io.Reader, buf []byte) *Reader {
	return &Reader{R: fwd.NewReaderBuf(r, buf)}
}
NewReaderBuf returns a *Reader with a provided buffer.
package msgp
import (
	"io"
	"math"
	"sync"
	"time"
	"github.com/gofiber/fiber/v2/internal/fwd"
)
var readerPool = sync.Pool{New: func() interface{} { return &Reader{} }}
type Type byte
const (
	InvalidType Type = iota
	StrType
	BinType
	MapType
	ArrayType
	Float64Type
	Float32Type
	BoolType
	IntType
	UintType
	NilType
	ExtensionType
	Complex64Type
	Complex128Type
	TimeType
	_maxtype
)
func (t Type) String() string {
	switch t {
	case StrType:
		return "str"
	case BinType:
		return "bin"
	case MapType:
		return "map"
	case ArrayType:
		return "array"
	case Float64Type:
		return "float64"
	case Float32Type:
		return "float32"
	case BoolType:
		return "bool"
	case UintType:
		return "uint"
	case IntType:
		return "int"
	case ExtensionType:
		return "ext"
	case NilType:
		return "nil"
	default:
		return "<invalid>"
	}
}
func freeR(m *Reader) {
	readerPool.Put(m)
}
type Unmarshaler interface {
	UnmarshalMsg([]byte) ([]byte, error)
}
type Decodable interface {
	DecodeMsg(*Reader) error
}
func Decode(r io.Reader, d Decodable) error {
	rd := NewReader(r)
	err := d.DecodeMsg(rd)
	freeR(rd)
	return err
}
func NewReader(r io.Reader) *Reader {
	p := readerPool.Get().(*Reader)
	if p.R == nil {
		p.R = fwd.NewReader(r)
	} else {
		p.R.Reset(r)
	}
	return p
}
func NewReaderSize(r io.Reader, sz int) *Reader {
	return &Reader{R: fwd.NewReaderSize(r, sz)}
}