// Decode decodes reponse proto from r.
169163
func (res *Response) Decode(r io.Reader) error {
	var buf [16]byte
	_, err := io.ReadFull(r, buf[0:16])
	if err != nil {
		return errors.Trace(err)
	}

	res.Physical = int64(binary.BigEndian.Uint64(buf[0:8]))
	res.Logical = int64(binary.BigEndian.Uint64(buf[8:16]))
	return nil
}
221975
func (d jsonDecoder) Decode(resp *http.Response, v interface{}) error {
	return json.NewDecoder(resp.Body).Decode(v)
}
279398
func (pp *Pingresp) Decode(src []byte) (int, error) {
	return nakedDecode(src, PINGRESP)
}
209720
func (d *Decoder) Decode(raw interface{}) error {
	return d.decode("", raw, reflect.ValueOf(d.config.Result).Elem())
}
132841
func (decoder StringDecoder) Decode(in *goetty.ByteBuf) (bool, interface{}, error) {
	_, data, err := in.ReadMarkedBytes()

	if err != nil {
		return true, "", err
	}

	return true, string(data), nil
}
526607
func (d *decoder) Decode(v interface{}) error {
	rv := reflect.ValueOf(v)
	if rv.Kind() != reflect.Ptr {
		return fmt.Errorf("cannot decode into non-pointer %T", v)
	}
	d.vs = [][]reflect.Value{{rv.Elem()}}
	return d.decode()
}
1001705
func (l *Loop) Decode(r io.Reader) error {
	*l = Loop{}
	d := &decoder{r: asByteReader(r)}
	l.decode(d)
	return d.err
}
871369
func (c *consulClient) Decode(in string) ([]byte, error) {
	return base64.URLEncoding.DecodeString(in)
}
893402
func (d *GetResult) Decode(valuePtr interface{}, decode Decode) error {
	if decode == nil {
		decode = DefaultDecode
	}
	return decode(d.contents, d.flags, valuePtr)
}
280681
func (message *Message) Decode(body []byte) error {
	if err := json.Unmarshal(body, message); err != nil {
		return err
	}

	return nil
}
855332
func (m *RcChannelsScaled) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.TIME_BOOT_MS)
	binary.Read(data, binary.LittleEndian, &m.CHAN1_SCALED)
	binary.Read(data, binary.LittleEndian, &m.CHAN2_SCALED)
	binary.Read(data, binary.LittleEndian, &m.CHAN3_SCALED)
	binary.Read(data, binary.LittleEndian, &m.CHAN4_SCALED)
	binary.Read(data, binary.LittleEndian, &m.CHAN5_SCALED)
	binary.Read(data, binary.LittleEndian, &m.CHAN6_SCALED)
	binary.Read(data, binary.LittleEndian, &m.CHAN7_SCALED)
	binary.Read(data, binary.LittleEndian, &m.CHAN8_SCALED)
	binary.Read(data, binary.LittleEndian, &m.PORT)
	binary.Read(data, binary.LittleEndian, &m.RSSI)
}
697924
func (f *FailInvalidOnionVersion) Decode(r io.Reader, pver uint32) error {
	return ReadElement(r, f.OnionSHA256[:])
}
51978
func decode(in convert.ReadSeekCloser) (*decoded, int, int, error) {
	r, err := oggvorbis.NewReader(in)
	if err != nil {
		return nil, 0, 0, err
	}
	d := &decoded{
		data:       make([]float32, r.Length()*2),
		totalBytes: int(r.Length()) * 4, // TODO: What if length is 0?
		posInBytes: 0,
		source:     in,
		decoder:    r,
	}
	runtime.SetFinalizer(d, (*decoded).Close)
	if _, err := d.Read(make([]uint8, 65536)); err != nil {
		return nil, 0, 0, err
	}
	if _, err := d.Seek(0, io.SeekStart); err != nil {
		return nil, 0, 0, err
	}
	return d, r.Channels(), r.SampleRate(), nil
}
713677
func (r *CachedResponseDecoder) Decode(req *sawyer.Request) *sawyer.Response {
	cached := r.CachedResponse
	res := &sawyer.Response{
		BodyClosed: false,
		MediaType:  &cached.MediaType,
		Response: &http.Response{
			Status:           cached.Status,
			StatusCode:       cached.StatusCode,
			Proto:            cached.Proto,
			ProtoMajor:       cached.ProtoMajor,
			ProtoMinor:       cached.ProtoMinor,
			Header:           cached.Header,
			ContentLength:    cached.ContentLength,
			TransferEncoding: cached.TransferEncoding,
			Trailer:          cached.Trailer,
			Request:          req.Request,
		},
	}

	res.Cacher = r.Cacher
	if res.Cacher == nil {
		res.Cacher = req.Cacher
	}

	if r.SetBodyFunc != nil {
		r.SetBodyFunc(res)
	}

	return res
}
769144
func (r *ReadState) Decode(reader io.ReadSeeker) error {
	return decode(r, reader)
}
1169574
func Decode(input string) ([]byte, error) {
	if len(input) == 0 {
		return nil, ErrEmptyString
	}
	if !has0xPrefix(input) {
		return nil, ErrMissingPrefix
	}
	b, err := hex.DecodeString(input[2:])
	if err != nil {
		err = mapError(err)
	}
	return b, err
}
871759
func (t *StateUpdateReply) Decode(r io.Reader, pver uint32) error {
	return ReadElements(r,
		&t.Code,
		&t.LastApplied,
	)
}