// Deserialize passes a []byte through as-is.
346729
func (e NopEncoder) Deserialize(src []byte, dst interface{}) error {
	if dat, ok := dst.(*[]byte); ok {
		*dat = src
		return nil
	}
	return errValueNotBytePtr
}
740153
func Deserialize(p []byte) (*up.Uptime, error) {
	var u up.Uptime
	err := json.Unmarshal(p, &u)
	if err != nil {
		return nil, err
	}
	return &u, nil
}
980960
func Deserialize(p []byte) (*structs.DiskStats, error) {
	st := &structs.DiskStats{}
	err := json.Unmarshal(p, st)
	if err != nil {
		return nil, err
	}
	return st, nil
}
765978
func (_m *IdentityDeserializer) DeserializeIdentity(serializedIdentity []byte) (msp.Identity, error) {
	ret := _m.Called(serializedIdentity)

	var r0 msp.Identity
	if rf, ok := ret.Get(0).(func([]byte) msp.Identity); ok {
		r0 = rf(serializedIdentity)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(msp.Identity)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = rf(serializedIdentity)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
338139
func (alert *Alert) Deserialize(r io.Reader, pver uint32) error {
	err := readElements(r, &alert.Version, &alert.RelayUntil,
		&alert.Expiration, &alert.ID, &alert.Cancel)
	if err != nil {
		return err
	}

	// SetCancel: first read a VarInt that contains
	// count - the number of Cancel IDs, then
	// iterate count times and read them
	count, err := ReadVarInt(r, pver)
	if err != nil {
		return err
	}
	if count > maxCountSetCancel {
		str := fmt.Sprintf("too many cancel alert IDs for alert "+
			"[count %v, max %v]", count, maxCountSetCancel)
		return messageError("Alert.Deserialize", str)
	}
	alert.SetCancel = make([]int32, count)
	for i := 0; i < int(count); i++ {
		err := readElement(r, &alert.SetCancel[i])
		if err != nil {
			return err
		}
	}

	err = readElements(r, &alert.MinVer, &alert.MaxVer)
	if err != nil {
		return err
	}

	// SetSubVer: similar to SetCancel
	// but read count number of sub-version strings
	count, err = ReadVarInt(r, pver)
	if err != nil {
		return err
	}
	if count > maxCountSetSubVer {
		str := fmt.Sprintf("too many sub versions for alert "+
			"[count %v, max %v]", count, maxCountSetSubVer)
		return messageError("Alert.Deserialize", str)
	}
	alert.SetSubVer = make([]string, count)
	for i := 0; i < int(count); i++ {
		alert.SetSubVer[i], err = ReadVarString(r, pver)
		if err != nil {
			return err
		}
	}

	err = readElement(r, &alert.Priority)
	if err != nil {
		return err
	}
	alert.Comment, err = ReadVarString(r, pver)
	if err != nil {
		return err
	}
	alert.StatusBar, err = ReadVarString(r, pver)
	if err != nil {
		return err
	}
	alert.Reserved, err = ReadVarString(r, pver)
	return err
}
645819
func DeserializeKeyring(buf []byte) (*Keyring, error) {
	// Deserialize the keyring
	var enc EncodedKeyring
	if err := jsonutil.DecodeJSON(buf, &enc); err != nil {
		return nil, errwrap.Wrapf("deserialization failed: {{err}}", err)
	}

	// Create a new keyring
	k := NewKeyring()
	k.masterKey = enc.MasterKey
	for _, key := range enc.Keys {
		k.keys[key.Term] = key
		if key.Term > k.activeTerm {
			k.activeTerm = key.Term
		}
	}
	return k, nil
}
308131
func Deserialize(p []byte) (*m.MemInfo, error) {
	var inf m.MemInfo
	err := json.Unmarshal(p, &inf)
	if err != nil {
		return nil, err
	}
	return &inf, nil
}
1124082
func Deserialize(p []byte) u.Uptime {
	flatUp := structs.GetRootAsUptime(p, 0)
	var up u.Uptime
	up.Timestamp = flatUp.Timestamp()
	up.Total = flatUp.Total()
	up.Idle = flatUp.Idle()
	return up
}
1248125
func Deserialize(p []byte) (*mem.Info, error) {
	info := &mem.Info{}
	err := json.Unmarshal(p, info)
	if err != nil {
		return nil, err
	}
	return info, nil
}
192658
func Deserialize(p []byte) *v.Kernel {
	flatK := structs.GetRootAsKernel(p, 0)
	var k v.Kernel
	k.OS = string(flatK.OS())
	k.Version = string(flatK.Version())
	k.CompileUser = string(flatK.CompileUser())
	k.GCC = string(flatK.GCC())
	k.OSGCC = string(flatK.OSGCC())
	k.Type = string(flatK.Type())
	k.CompileDate = string(flatK.CompileDate())
	k.Arch = string(flatK.Arch())
	return &k
}
90902
func (s JSONSerializer) Deserialize(d []byte, ss *sessions.Session) error {
	m := make(map[string]interface{})
	err := json.Unmarshal(d, &m)
	if err != nil {
		fmt.Printf("redistore.JSONSerializer.deserialize() Error: %v", err)
		return err
	}
	for k, v := range m {
		ss.Values[k] = v
	}
	return nil
}
1115592
func Deserialize(p []byte) *cpux.CPUs {
	fcpus := structs.GetRootAsCPUs(p, 0)
	l := fcpus.CPULength()
	cpus := &cpux.CPUs{}
	fCPU := &structs.CPU{}
	fCache := &structs.CacheInf{}
	cpu := cpux.CPU{}
	cpus.Sockets = fcpus.Sockets()
	cpus.Possible = string(fcpus.Possible())
	cpus.Online = string(fcpus.Online())
	cpus.Present = string(fcpus.Present())
	for i := 0; i < l; i++ {
		if !fcpus.CPU(fCPU, i) {
			continue
		}
		cpu.PhysicalPackageID = fCPU.PhysicalPackageID()
		cpu.CoreID = fCPU.CoreID()
		cpu.MHzMin = fCPU.MHzMin()
		cpu.MHzMax = fCPU.MHzMax()
		caches := fCPU.CacheLength()
		cpu.CacheIDs = make([]string, 0, caches)
		cpu.Cache = make(map[string]string, caches)
		for j := 0; j < caches; j++ {
			if !fCPU.Cache(fCache, j) {
				continue
			}
			cpu.CacheIDs = append(cpu.CacheIDs, string(fCache.ID()))
			cpu.Cache[cpu.CacheIDs[j]] = string(fCache.Size())
		}
		cpus.CPU = append(cpus.CPU, cpu)
	}
	return cpus
}
880521
func (h *BlockHeader) Deserialize(r io.Reader) error {
	// At the current time, there is no difference between the wire encoding
	// at protocol version 0 and the stable long-term storage format.  As
	// a result, make use of readBlockHeader.
	return readBlockHeader(r, 0, h)
}
917210
func Deserialize(p []byte) *load.LoadAvg {
	lF := structs.GetRootAsLoadAvg(p, 0)
	l := &load.LoadAvg{}
	l.Timestamp = lF.Timestamp()
	l.One = lF.One()
	l.Five = lF.Five()
	l.Fifteen = lF.Fifteen()
	return l
}
673332
func Deserialize(p []byte) *freq.Frequency {
	ff := structs.GetRootAsFrequency(p, 0)
	l := ff.CPULength()
	f := &freq.Frequency{}
	fCPU := &structs.CPU{}
	cpu := freq.CPU{}
	f.Timestamp = ff.Timestamp()
	f.Sockets = ff.Sockets()
	for i := 0; i < l; i++ {
		if !ff.CPU(fCPU, i) {
			continue
		}
		cpu.Processor = fCPU.Processor()
		cpu.CPUMHz = fCPU.CPUMHz()
		cpu.PhysicalID = fCPU.PhysicalID()
		cpu.CoreID = fCPU.CoreID()
		cpu.APICID = fCPU.APICID()
		f.CPU = append(f.CPU, cpu)
	}
	return f
}
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
}
844102
func Deserialize(p []byte) (*util.CPUUtil, error) {
	ut := &util.CPUUtil{}
	err := json.Unmarshal(p, ut)
	if err != nil {
		return nil, err
	}
	return ut, nil
}