package runtime

import (
	
	
)

// JSONBuiltin is a Marshaler which marshals/unmarshals into/from JSON
// with the standard "encoding/json" package of Golang.
// Although it is generally faster for simple proto messages than JSONPb,
// it does not support advanced features of protobuf, e.g. map, oneof, ....
//
// The NewEncoder and NewDecoder types return *json.Encoder and
// *json.Decoder respectively.
type JSONBuiltin struct{}

// ContentType always Returns "application/json".
func (*JSONBuiltin) ( interface{}) string {
	return "application/json"
}

// Marshal marshals "v" into JSON
func ( *JSONBuiltin) ( interface{}) ([]byte, error) {
	return json.Marshal()
}

// MarshalIndent is like Marshal but applies Indent to format the output
func ( *JSONBuiltin) ( interface{}, ,  string) ([]byte, error) {
	return json.MarshalIndent(, , )
}

// Unmarshal unmarshals JSON data into "v".
func ( *JSONBuiltin) ( []byte,  interface{}) error {
	return json.Unmarshal(, )
}

// NewDecoder returns a Decoder which reads JSON stream from "r".
func ( *JSONBuiltin) ( io.Reader) Decoder {
	return json.NewDecoder()
}

// NewEncoder returns an Encoder which writes JSON stream into "w".
func ( *JSONBuiltin) ( io.Writer) Encoder {
	return json.NewEncoder()
}

// Delimiter for newline encoded JSON streams.
func ( *JSONBuiltin) () []byte {
	return []byte("\n")
}