// NewEncoder returns an Encoder able to convert uint64s to compressed byte slices
355792
func NewEncoder() *Encoder {
	return &Encoder{
		buf:   make([]uint64, 240),
		b:     make([]byte, 8),
		bytes: make([]byte, 128),
	}
}
1207042
func (j *JSONMarshaler) NewEncoder(w io.Writer) gwruntime.Encoder {
	return json.NewEncoder(w)
}
1124030
func (j *JSONBuiltin) NewDecoder(r io.Reader) Decoder {
	return json.NewDecoder(r)
}
864383
func NewEncoder(w io.Writer) goa.Encoder {
	return codec.NewEncoder(w, &Handle)
}
1075902
func NewEncoder(w io.Writer) *Encoder {
	enc := Encoder{syms: make(map[string]int, 0), tags: make(map[string]*tagDef, 0), nextTag: FirstUserTag}
	enc.out = w
	enc.bytebuf = make([]byte, 32)
	enc.writeHeader()
	return &enc
}
393873
func NewEncoder(w io.Writer) *Encoder {
	return &Encoder{w, make([]byte, minEncode)}
}
1255247
func NewDecoder(r io.Reader) (*Decoder, error) {
	s := &source{
		reader: r,
	}
	d := &Decoder{
		source: s,
		length: invalidLength,
	}

	if err := s.skipTags(); err != nil {
		return nil, err
	}
	// TODO: Is readFrame here really needed?
	if err := d.readFrame(); err != nil {
		return nil, err
	}
	d.sampleRate = d.frame.SamplingFrequency()

	if err := d.ensureFrameStartsAndLength(); err != nil {
		return nil, err
	}

	return d, nil
}
825953
func NewDecoder(r io.Reader) *Decoder {
	dec := &Decoder{
		s: bufio.NewScanner(r),
	}
	return dec
}
393574
func NewEncoder(writer io.Writer, maxWriteDelay time.Duration) *Encoder {
	return &Encoder{
		writer: mercury.NewWriter(writer, maxWriteDelay),
	}
}
918797
func NewDecoder(rd io.Reader) Decoder {
	dec := gob.NewDecoder(rd)
	return func(r *Result) error { return dec.Decode(r) }
}
367297
func NewCSVEncoder(w io.Writer) Encoder {
	enc := csv.NewWriter(w)
	return func(r *Result) error {
		err := enc.Write([]string{
			strconv.FormatInt(r.Timestamp.UnixNano(), 10),
			strconv.FormatUint(uint64(r.Code), 10),
			strconv.FormatInt(r.Latency.Nanoseconds(), 10),
			strconv.FormatUint(r.BytesOut, 10),
			strconv.FormatUint(r.BytesIn, 10),
			r.Error,
			base64.StdEncoding.EncodeToString(r.Body),
			r.Attack,
			strconv.FormatUint(r.Seq, 10),
		})

		if err != nil {
			return err
		}

		enc.Flush()

		return enc.Error()
	}
}
1233250
func (p *Proto) NewEncoder(writer io.Writer) runtime.Encoder {
	return runtime.EncoderFunc(func(value interface{}) error {
		buffer, err := p.Marshal(value)
		if err != nil {
			return err
		}
		_, err = writer.Write(buffer)
		if err != nil {
			return err
		}
		return nil
	})
}
354768
func NewDecoder(data []byte) *Decoder {
	return &Decoder{
		data: data,
		end:  len(data),
	}
}
354805
func NewDecoder(r io.Reader) *Decoder {
	return &Decoder{
		dec: codec.NewDecoder(r, new(codec.CborHandle)),
	}
}
1250617
func NewDecoder(s encoding.Source) encoding.Decoder {
	r := s()
	dec := framing.NewDecoder(r, json.Unmarshal)
	return encoding.DecoderFunc(func(u encoding.Unmarshaler) error { return dec.Decode(u) })
}
1070257
func NewDecoder(r io.Reader) *Decoder {
	return &Decoder{
		called:   0,
		cursor:   0,
		keysDone: 0,
		err:      nil,
		r:        r,
		data:     make([]byte, 512),
		length:   0,
		isPooled: 0,
	}
}
761021
func NewDecoder(r io.Reader) *Decoder {
	decoder := new(Decoder)
	decoder.pendingTag = -1
	decoder.syms = make([]string, 0)
	decoder.in = bufio.NewReader(r)
	//	decoder.currentCursor = nil
	decoder.readHeader()
	return decoder
}