// Decode accepts a packed byte array and populates the fields of the BatteryStatus
976706
func (m *BatteryStatus) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.CURRENT_CONSUMED)
	binary.Read(data, binary.LittleEndian, &m.ENERGY_CONSUMED)
	binary.Read(data, binary.LittleEndian, &m.VOLTAGE_CELL_1)
	binary.Read(data, binary.LittleEndian, &m.VOLTAGE_CELL_2)
	binary.Read(data, binary.LittleEndian, &m.VOLTAGE_CELL_3)
	binary.Read(data, binary.LittleEndian, &m.VOLTAGE_CELL_4)
	binary.Read(data, binary.LittleEndian, &m.VOLTAGE_CELL_5)
	binary.Read(data, binary.LittleEndian, &m.VOLTAGE_CELL_6)
	binary.Read(data, binary.LittleEndian, &m.CURRENT_BATTERY)
	binary.Read(data, binary.LittleEndian, &m.ACCU_ID)
	binary.Read(data, binary.LittleEndian, &m.BATTERY_REMAINING)
}
190215
func Decode(b []byte, size int) ([]types.Datum, error) {
	if len(b) < 1 {
		return nil, errors.New("invalid encoded key")
	}

	var (
		err    error
		values = make([]types.Datum, 0, size)
	)

	for len(b) > 0 {
		var d types.Datum
		b, d, err = DecodeOne(b)
		if err != nil {
			return nil, errors.Trace(err)
		}

		values = append(values, d)
	}

	return values, nil
}
360072
func (message *Message) decode(decoder *gob.Decoder) {
	err := decoder.Decode(&message)
	if err != nil {
		Logln("Can't encode", err)
	}
}
866812
func (m *DeleteSessionReply) Decode(r io.Reader, pver uint32) error {
	return ReadElements(r,
		&m.Code,
	)
}
739276
func (m *LogRequestData) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.OFS)
	binary.Read(data, binary.LittleEndian, &m.COUNT)
	binary.Read(data, binary.LittleEndian, &m.ID)
	binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM)
	binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT)
}
881337
func (d *Decoder) Decode(v interface{}) error {
	var err error
	d.tval, err = LoadReader(d.r)
	if err != nil {
		return err
	}
	return d.unmarshal(v)
}
728333
func (m *StateUpdate) Decode(r io.Reader, pver uint32) error {
	return ReadElements(r,
		&m.SeqNum,
		&m.LastApplied,
		&m.IsComplete,
		&m.Hint,
		&m.EncryptedBlob,
	)
}
892511
func (c *UpdateAddHTLC) Decode(r io.Reader, pver uint32) error {
	return ReadElements(r,
		&c.ChanID,
		&c.ID,
		&c.Amount,
		c.PaymentHash[:],
		&c.Expiry,
		c.OnionBlob[:],
	)
}
124596
func Decode(data []byte, defaultReadVersion *schema.GroupVersionKind) (runtime.Object, *schema.GroupVersionKind, error) {
	decoder := decoder()

	object, gvk, err := decoder.Decode(data, defaultReadVersion, nil)
	return object, gvk, err
}
318443
func (m *GpsInjectData) Decode(buf []byte) {
	data := bytes.NewBuffer(buf)
	binary.Read(data, binary.LittleEndian, &m.TARGET_SYSTEM)
	binary.Read(data, binary.LittleEndian, &m.TARGET_COMPONENT)
	binary.Read(data, binary.LittleEndian, &m.LEN)
	binary.Read(data, binary.LittleEndian, &m.DATA)
}
236761
func (dec *Decoder) Decode(v interface{}) error {
	data, err := dec.Reader.Read()
	if err != nil {
		return err
	}
	return json.Unmarshal(data, v)
}
1326121
func (c *ReplyShortChanIDsEnd) Decode(r io.Reader, pver uint32) error {
	return ReadElements(r,
		c.ChainHash[:],
		&c.Complete,
	)
}
472149
func Decode(data []byte) (result interface{}, err error) {
	result, _, err = decodeItem(data, 0)
	return
}
1267732
func Decode(d Decoder, data []byte) (Object, error) {
	return d.Decode(data)
}
8326
func Decode(src []byte, mode int) (inst Inst, err error) {
	return decode1(src, mode, false)
}
697924
func (f *FailInvalidOnionVersion) Decode(r io.Reader, pver uint32) error {
	return ReadElement(r, f.OnionSHA256[:])
}
700118
func (d *decoder) Decode(defaults *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
	base := 0
	for {
		n, err := d.reader.Read(d.buf[base:])
		if err == io.ErrShortBuffer {
			if n == 0 {
				return nil, nil, fmt.Errorf("got short buffer with n=0, base=%d, cap=%d", base, cap(d.buf))
			}
			if d.resetRead {
				continue
			}
			// double the buffer size up to maxBytes
			if len(d.buf) < d.maxBytes {
				base += n
				d.buf = append(d.buf, make([]byte, len(d.buf))...)
				continue
			}
			// must read the rest of the frame (until we stop getting ErrShortBuffer)
			d.resetRead = true
			base = 0
			return nil, nil, ErrObjectTooLarge
		}
		if err != nil {
			return nil, nil, err
		}
		if d.resetRead {
			// now that we have drained the large read, continue
			d.resetRead = false
			continue
		}
		base += n
		break
	}
	return d.decoder.Decode(d.buf[:base], defaults, into)
}