// Decode accepts a packed byte array and populates the fields of the GpsRtk
481901
func (m *GpsRtk) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.TIME_LAST_BASELINE_MS)
	binary.Read(data, binary.LittleEndian, &m.TOW)
	binary.Read(data, binary.LittleEndian, &m.BASELINE_A_MM)
	binary.Read(data, binary.LittleEndian, &m.BASELINE_B_MM)
	binary.Read(data, binary.LittleEndian, &m.BASELINE_C_MM)
	binary.Read(data, binary.LittleEndian, &m.ACCURACY)
	binary.Read(data, binary.LittleEndian, &m.IAR_NUM_HYPOTHESES)
	binary.Read(data, binary.LittleEndian, &m.WN)
	binary.Read(data, binary.LittleEndian, &m.RTK_RECEIVER_ID)
	binary.Read(data, binary.LittleEndian, &m.RTK_HEALTH)
	binary.Read(data, binary.LittleEndian, &m.RTK_RATE)
	binary.Read(data, binary.LittleEndian, &m.NSATS)
	binary.Read(data, binary.LittleEndian, &m.BASELINE_COORDS_TYPE)
}
361892
func (u *DefaultDecoder) Decode(data []byte, v interface{}) error {
	return json.Unmarshal(data, v)
}
748590
func (d *Decoder) Decode(v interface{}) (err error) {
	data := C.pn_data(0)
	defer C.pn_data_free(data)
	var n int
	for n, err = decode(data, d.buffer.Bytes()); err == EndOfData; {
		err = d.more()
		if err == nil {
			n, err = decode(data, d.buffer.Bytes())
		}
	}
	if err == nil {
		if err = recoverUnmarshal(v, data); err == nil {
			d.buffer.Next(n)
		}
	}
	return
}
797993
func (m *TerrainRequest) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.MASK)
	binary.Read(data, binary.LittleEndian, &m.LAT)
	binary.Read(data, binary.LittleEndian, &m.LON)
	binary.Read(data, binary.LittleEndian, &m.GRID_SPACING)
}
336970
func (d *Decoder) Decode(v interface{}) (int, error) {
	if v == nil {
		msg := "can't unmarshal to nil interface"
		return 0, unmarshalError("Unmarshal", ErrNilInterface, msg, nil,
			nil)
	}

	vv := reflect.ValueOf(v)
	if vv.Kind() != reflect.Ptr {
		msg := fmt.Sprintf("can't unmarshal to non-pointer '%v' - use "+
			"& operator", vv.Type().String())
		err := unmarshalError("Unmarshal", ErrBadArguments, msg, nil, nil)
		return 0, err
	}
	if vv.IsNil() && !vv.CanSet() {
		msg := fmt.Sprintf("can't unmarshal to unsettable '%v' - use "+
			"& operator", vv.Type().String())
		err := unmarshalError("Unmarshal", ErrNotSettable, msg, nil, nil)
		return 0, err
	}

	return d.decode(vv)
}
280681
func (message *Message) Decode(body []byte) error {
	if err := json.Unmarshal(body, message); err != nil {
		return err
	}

	return nil
}
1073634
func decode(data []byte) (*api.Config, error) {
	// if no data, return empty config
	if len(data) == 0 {
		return api.NewConfig(), nil
	}

	config, _, err := latest.Codec.Decode(data, nil, nil)
	if err != nil {
		return nil, errors.Wrapf(err, "Error decoding config from data: %s", string(data))
	}

	return config.(*api.Config), nil
}
1296655
func Decode(r io.Reader, v interface{}, order binary.ByteOrder) error {
	b, err := Read(r, order)
	if err != nil {
		return err
	}
	err = json.Unmarshal(b, v)
	if err != nil {
		return errors.New(err.Error() + string(b))
	}
	return nil
}
1289919
func decode(dst, src []byte) int {
	var d, s, offset, length int
	for s < len(src) {
		switch src[s] & 0x03 {
		case tagLiteral:
			x := uint32(src[s] >> 2)
			switch {
			case x < 60:
				s++
			case x == 60:
				s += 2
				if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
					return decodeErrCodeCorrupt
				}
				x = uint32(src[s-1])
			case x == 61:
				s += 3
				if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
					return decodeErrCodeCorrupt
				}
				x = uint32(src[s-2]) | uint32(src[s-1])<<8
			case x == 62:
				s += 4
				if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
					return decodeErrCodeCorrupt
				}
				x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16
			case x == 63:
				s += 5
				if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
					return decodeErrCodeCorrupt
				}
				x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24
			}
			length = int(x) + 1
			if length <= 0 {
				return decodeErrCodeUnsupportedLiteralLength
			}
			if length > len(dst)-d || length > len(src)-s {
				return decodeErrCodeCorrupt
			}
			copy(dst[d:], src[s:s+length])
			d += length
			s += length
			continue

		case tagCopy1:
			s += 2
			if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
				return decodeErrCodeCorrupt
			}
			length = 4 + int(src[s-2])>>2&0x7
			offset = int(uint32(src[s-2])&0xe0<<3 | uint32(src[s-1]))

		case tagCopy2:
			s += 3
			if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
				return decodeErrCodeCorrupt
			}
			length = 1 + int(src[s-3])>>2
			offset = int(uint32(src[s-2]) | uint32(src[s-1])<<8)

		case tagCopy4:
			s += 5
			if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
				return decodeErrCodeCorrupt
			}
			length = 1 + int(src[s-5])>>2
			offset = int(uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24)
		}

		if offset <= 0 || d < offset || length > len(dst)-d {
			return decodeErrCodeCorrupt
		}
		// Copy from an earlier sub-slice of dst to a later sub-slice. Unlike
		// the built-in copy function, this byte-by-byte copy always runs
		// forwards, even if the slices overlap. Conceptually, this is:
		//
		// d += forwardCopy(dst[d:d+length], dst[d-offset:])
		for end := d + length; d != end; d++ {
			dst[d] = dst[d-offset]
		}
	}
	if d != len(dst) {
		return decodeErrCodeCorrupt
	}
	return 0
}
451056
func (d *wktDecoder) decode(wkt string) (*Geometry, error) {
	cstr := C.CString(wkt)
	defer C.free(unsafe.Pointer(cstr))
	g := cGEOSWKTReader_read(d.r, cstr)
	if g == nil {
		return nil, Error()
	}
	return geomFromPtr(g), nil
}
968750
func decode(input interface{}, config *mapstructure.DecoderConfig) error {
	decoder, err := mapstructure.NewDecoder(config)
	if err != nil {
		return err
	}
	return decoder.Decode(input)
}
795155
func (s *Stream) Decode(val interface{}) error {
	if val == nil {
		return errDecodeIntoNil
	}
	rval := reflect.ValueOf(val)
	rtyp := rval.Type()
	if rtyp.Kind() != reflect.Ptr {
		return errNoPointer
	}
	if rval.IsNil() {
		return errDecodeIntoNil
	}
	info, err := cachedTypeInfo(rtyp.Elem(), tags{})
	if err != nil {
		return err
	}

	err = info.decoder(s, rval.Elem())
	if decErr, ok := err.(*decodeError); ok && len(decErr.ctx) > 0 {
		// add decode target type to error so context has more meaning
		decErr.ctx = append(decErr.ctx, fmt.Sprint("(", rtyp.Elem(), ")"))
	}
	return err
}
720631
func Decode(s string) (geom.T, error) {
	data, err := hex.DecodeString(s)
	if err != nil {
		return nil, err
	}
	return wkb.Unmarshal(data)
}
1309879
func (m *Unmarshaller) Decode(r io.Reader, obj interface{}) error {
	m.reader.r = r
	err := m.unmarshal.Unmarshal(obj)
	m.reader.r = nil
	return err
}
1081075
func Decode(dst, src []byte) (int, error) {
	dLen := DecodedLen(len(src))
	if EncodedLen(dLen) != len(src) {
		return 0, ErrLength
	}
	if len(dst) < dLen {
		panic("dst has insufficient length")
	}
	dst = dst[:0]
	whichByte := uint(1)
	bufByte := byte(0)
	for _, v := range src {
		if (v & 0x80) != 0 {
			return len(dst), ErrBit
		}
		if whichByte > 1 {
			dst = append(dst, bufByte|(v>>(8-whichByte)))
		}
		bufByte = v << whichByte
		if whichByte == 8 {
			whichByte = 0
		}
		whichByte++
	}
	return len(dst), nil
}
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
}
1006972
func (r *Rect) Decode(rd io.Reader) error {
	d := &decoder{r: asByteReader(rd)}
	r.decode(d)
	return d.err
}