func NewDecoder(vr bsonrw.ValueReader) (*Decoder, error) {
	if vr == nil {
		return nil, errors.New("cannot create a new Decoder with a nil ValueReader")
	}

	return &Decoder{
		dc: bsoncodec.DecodeContext{Registry: DefaultRegistry},
		vr: vr,
	}, nil
}
// NewDecoder returns a new decoder that uses the DefaultRegistry to read from vr.
NewDecoder returns a new decoder that uses the DefaultRegistry to read from vr.
// NewDecoder returns a new decoder that uses the DefaultRegistry to read from vr .
func NewDecoder(vr bsonrw.ValueReader) (*Decoder, error) {
	if vr == nil {
		return nil, errors.New("cannot create a new Decoder with a nil ValueReader")
	}
	return &Decoder{
		dc: bsoncodec.DecodeContext{Registry: DefaultRegistry},
		vr: vr,
	}, nil
}
func NewDecoder ( vr bsonrw . ValueReader ) ( * Decoder , error ) { if vr == nil { return nil , errors . New ( " " ) } return & Decoder { dc : bsoncodec . DecodeContext { Registry : DefaultRegistry } , vr : vr , } , nil }
NewDecoder returns a new decoder that uses the DefaultRegistry to read from vr.
NewDecoder returns a new decoder that uses the DefaultRegistry to read from vr .