// UnmarshalFromReader reads all the data in the reader and decodes as JSON into the object. func UnmarshalFromReader(r io.Reader, v Unmarshaler) error { data, err := ioutil.ReadAll(r) if err != nil { return err } l := jlexer.Lexer{Data: data} v.UnmarshalEasyJSON(&l) return l.Error() }
// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. func (v *Int32) UnmarshalEasyJSON(l *jlexer.Lexer) { if l.IsNull() { l.Skip() *v = Int32{} } else { v.V = l.Int32() v.Defined = true } }
// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. func (v *Optional) UnmarshalEasyJSON(l *jlexer.Lexer) { if l.IsNull() { l.Skip() *v = Optional{} } else { v.V = l.Optional() v.Defined = true } }
// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. func (v *Uint64) UnmarshalEasyJSON(l *jlexer.Lexer) { if l.IsNull() { l.Skip() *v = Uint64{} } else { v.V = l.Uint64() v.Defined = true } }
// MarshalJSON implements a standard json marshaler interface. func (v *Int32) UnmarshalJSON(data []byte) error { l := jlexer.Lexer{} v.UnmarshalEasyJSON(&l) return l.Error() }
// Unmarshal decodes the JSON in data into the object. func Unmarshal(data []byte, v Unmarshaler) error { l := jlexer.Lexer{Data: data} v.UnmarshalEasyJSON(&l) return l.Error() }