decoder.go
func NewDecoder(reg Registry, r io.Reader) Decoder {
	var buf []byte
	return decoder{reg, DefaultMaxSize, bytes.NewBuffer(buf), bufio.NewReader(r)}
}
func NewDecoder(reg Registry, r io.Reader) Decoder {
	var buf []byte
	return decoder{reg, DefaultMaxSize, bytes.NewBuffer(buf), bufio.NewReader(r)}
}
// NewDecoder creates a new Decoder using a type Registry and an io.Reader.