func (d *Decoder) Bool() bool {
	if d.n != 0 {
		return true
	}
	return false
}
Bool returns the current Bool value.
package msgpack
import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
)
type Type int
const (
	Invalid Type = iota
	Nil
	Bool
	Int
	Uint
	Float
	ArrayLen
	MapLen
	String
	Binary
	Extension
)
var typeNames = [...]string{
	Invalid:   "Invalid",
	Nil:       "Nil",
	Bool:      "Bool",
	Int:       "Int",
	Uint:      "Uint",
	Float:     "Float",
	ArrayLen:  "ArrayLen",
	MapLen:    "MapLen",
	String:    "String",
	Binary:    "Binary",
	Extension: "Extension",
}
func (t Type) String() string {
	var n string
	if 0 <= t && t < Type(len(typeNames)) {
		n = typeNames[t]
	}
	if n == "" {
		n = "unknown"
	}
	return n
}
var ErrDataSizeTooLarge = errors.New("msgpack: data size too large")
type Decoder struct {
	extensions ExtensionMap
	err        error
	r          *bufio.Reader
	n          uint64
	p          []byte
	t          Type
	peek       bool
}
const bufioReaderSize = 4096
func NewDecoder(r io.Reader) *Decoder {
	return &Decoder{
		r: bufio.NewReaderSize(r, bufioReaderSize),
	}
}
type ExtensionMap map[int]func([]byte) (interface{}, error)
func (d *Decoder) SetExtensions(extensions ExtensionMap) {
	d.extensions = extensions
}
func (d *Decoder) Type() Type {
	return d.t
}
func (d *Decoder) Extension() int {
	return int(d.n)
}
func (d *Decoder) Bytes() []byte {
	if d.peek {
		p := make([]byte, len(d.p))
		copy(p, d.p)
		d.p = p
	}
	return d.p
}
func (d *Decoder) BytesNoCopy() []byte {
	return d.p
}
func (d *Decoder) String() string {
	return string(d.p)
}
func (d *Decoder) Int() int64 {
	return int64(d.n)
}
func (d *Decoder) Uint() uint64 {
	return d.n
}
func (d *Decoder) Len() int {
	return int(d.n)
}