// NewDecoder returns a new decoder that reads from r.
504373
func NewDecoder(r io.Reader) *Decoder {
	return &Decoder{
		r:       r,
		encOpts: encOptsDefaults,
		tagName: tagFieldName,
	}
}
1042054
func NewEncoder(w io.Writer, codec runtime.Codec) *Encoder {
	return &Encoder{
		w:       w,
		encoder: json.NewEncoder(w),
		codec:   codec,
	}
}
484247
func NewDecoder(r io.Reader) Decoder {
	return Decoder{
		r:   r,
		buf: &bytes.Buffer{},
	}
}
962794
func (j *JSONPb) NewDecoder(r io.Reader) runtime.Decoder {
	d := json.NewDecoder(r)
	return runtime.DecoderFunc(func(v interface{}) error { return decodeJSONPb(d, v) })
}
102298
func NewReader(r io.Reader) *Reader {
	return &Reader{
		r:       r,
		decoded: make([]byte, maxBlockSize),
		buf:     make([]byte, maxEncodedLenOfMaxBlockSize+checksumSize),
	}
}
1108407
func NewEncoder(w io.Writer, chunkSize uint16) Encoder {
	return Encoder{
		w:         w,
		buf:       &bytes.Buffer{},
		chunkSize: chunkSize,
	}
}
1051101
func (c *Charmap) NewEncoder() *encoding.Encoder {
	c.Init()
	return &encoding.Encoder{
		Transformer: &cmapEncoder{
			bytes:   c.bytes,
			replace: c.ReplacementChar,
		},
	}
}
659920
func NewDecoder(r io.Reader, format Format) Decoder {
	switch format {
	case FmtProtoDelim:
		return &protoDecoder{r: r}
	}
	return &textDecoder{r: r}
}
994514
func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder {
	return json.NewEncoder(w)
}
206281
func NewEncoder(w io.Writer) goa.Encoder {
	return &ProtoEncoder{
		pBuf: proto.NewBuffer(nil),
		w:    w,
	}
}
1030168
func (marshaller *ProtoMarshaller) NewEncoder(writer io.Writer) Encoder {
	return EncoderFunc(func(value interface{}) error {
		buffer, err := marshaller.Marshal(value)
		if err != nil {
			return err
		}
		_, err = writer.Write(buffer)
		if err != nil {
			return err
		}

		return nil
	})
}
303949
func NewDecoder(decoder streaming.Decoder, embeddedDecoder runtime.Decoder) *Decoder {
	return &Decoder{
		decoder:         decoder,
		embeddedDecoder: embeddedDecoder,
	}
}
657755
func (j *GoGoJSONPb) NewDecoder(r io.Reader) Decoder {
	d := json.NewDecoder(r)
	return DecoderFunc(func(v interface{}) error { return decodeGoGoJSONPb(d, v) })
}
77094
func NewEncoder(r io.Writer) Encoder {
	enc := gob.NewEncoder(r)
	return func(r *Result) error { return enc.Encode(r) }
}
864383
func NewEncoder(w io.Writer) goa.Encoder {
	return codec.NewEncoder(w, &Handle)
}
241979
func NewDecoder(r io.Reader) goa.Decoder {
	return &ProtoDecoder{
		pBuf: proto.NewBuffer(nil),
		bBuf: &bytes.Buffer{},
		r:    r,
	}
}
1075389
func (p *Proto) NewDecoder(reader io.Reader) runtime.Decoder {
	return runtime.DecoderFunc(func(value interface{}) error {
		buffer, err := ioutil.ReadAll(reader)
		if err != nil {
			return err
		}
		return p.Unmarshal(buffer, value)
	})
}