// GobDecode decodes a GOB into a ConfigDataNode
338815
func (c *ConfigDataNode) GobDecode(buf []byte) error {
	r := bytes.NewBuffer(buf)
	c.mutex = new(sync.Mutex)
	decoder := gob.NewDecoder(r)
	return decoder.Decode(&c.table)
}
765904
func GenHelperDecoder(d *Decoder) (gd genHelperDecoder, dd genHelperDecDriver) {
	gd = genHelperDecoder{d: d}
	dd = genHelperDecDriver{decDriver: d.d}
	return
}
98314
func base64Decode(s string) ([]byte, error) {
	// add back missing padding
	switch len(s) % 4 {
	case 2:
		s += "=="
	case 3:
		s += "="
	}
	return base64.URLEncoding.DecodeString(s)
}
1017953
func (n *node) GobEncode() ([]byte, error) {
	w := new(bytes.Buffer)
	encoder := gob.NewEncoder(w)
	if err := encoder.Encode(n.nodes); err != nil {
		return nil, err
	}
	if err := encoder.Encode(n.keys); err != nil {
		return nil, err
	}
	if err := encoder.Encode(n.keysBytes); err != nil {
		return nil, err
	}
	if err := encoder.Encode(&n.Node); err != nil {
		return nil, err
	}
	return w.Bytes(), nil
}
1269103
func (c *ConfigTree) GobDecode(buf []byte) error {
	r := bytes.NewBuffer(buf)
	decoder := gob.NewDecoder(r)
	if err := decoder.Decode(&c.root); err != nil {
		return err
	}
	return nil
}
306480
func (s *StringRule) GobDecode(buf []byte) error {
	r := bytes.NewBuffer(buf)
	decoder := gob.NewDecoder(r)
	if err := decoder.Decode(&s.key); err != nil {
		return err
	}
	if err := decoder.Decode(&s.required); err != nil {
		return err
	}
	var is_default_set bool
	decoder.Decode(&is_default_set)
	if is_default_set {
		return decoder.Decode(&s.default_)
	}
	return nil
}
234935
func (h *HyperLogLogPlus) GobDecode(b []byte) error {
	dec := gob.NewDecoder(bytes.NewBuffer(b))
	if err := dec.Decode(&h.reg); err != nil {
		return err
	}
	if err := dec.Decode(&h.m); err != nil {
		return err
	}
	if err := dec.Decode(&h.p); err != nil {
		return err
	}
	if err := dec.Decode(&h.sparse); err != nil {
		return err
	}
	if h.sparse {
		if err := dec.Decode(&h.tmpSet); err != nil {
			return err
		}
		h.sparseList = newCompressedList(int(h.m))
		if err := dec.Decode(&h.sparseList.Count); err != nil {
			return err
		}
		if err := dec.Decode(&h.sparseList.b); err != nil {
			return err
		}
		if err := dec.Decode(&h.sparseList.last); err != nil {
			return err
		}
	}
	return nil
}
1186353
func (g GobEncoder) Encode(v interface{}) ([]byte, error) {
	var buf bytes.Buffer
	e := gob.NewEncoder(&buf)
	err := e.Encode(v)
	return buf.Bytes(), err
}
1136187
func (r ContainerDecoder) DecodeConfig(src io.Reader) (*container.Config, *container.HostConfig, *networktypes.NetworkingConfig, error) {
	return decodeContainerConfig(src)
}
700663
func defaultDecoderConfig(output interface{}, opts ...DecoderConfigOption) *mapstructure.DecoderConfig {
	c := &mapstructure.DecoderConfig{
		Metadata:         nil,
		Result:           output,
		WeaklyTypedInput: true,
		DecodeHook: mapstructure.ComposeDecodeHookFunc(
			mapstructure.StringToTimeDurationHookFunc(),
			mapstructure.StringToSliceHookFunc(","),
		),
	}
	for _, opt := range opts {
		opt(c)
	}
	return c
}
1353587
func (d Decoder) Decode() (interface{}, error) {
	data, err := d.read()
	if err != nil {
		return nil, err
	}

	return d.decode(data)
}
1130487
func (b binaryEncoderDecoder) Decode(data []byte, v interface{}) error {
	buf := bytes.NewBuffer(data)
	dec := gob.NewDecoder(buf)
	return dec.Decode(v)
}
558942
func (z *Dec) GobDecode(buf []byte) error {
	if len(buf) == 0 {
		return fmt.Errorf("Dec.GobDecode: no data")
	}
	b := buf[len(buf)-1]
	if b != decGobVersion {
		return fmt.Errorf("Dec.GobDecode: encoding version %d not supported", b)
	}
	l := len(buf) - scaleSize - 1
	err := z.UnscaledBig().GobDecode(buf[:l])
	if err != nil {
		return err
	}
	z.SetScale(scale(buf[l : l+scaleSize]))
	return nil
}
504685
func (b *BloomFilter) GobEncode() ([]byte, error) {
	var buf bytes.Buffer
	_, err := b.WriteTo(&buf)
	if err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}
1272739
func (e *Error) GobDecode(data []byte) error {
	buf := bytes.NewBuffer(data)
	dec := gob.NewDecoder(buf)
	var msg messageType
	err := dec.Decode(&msg)
	if err != nil {
		return err
	}
	switch msg {
	case ErrorLocal:
		var er *Error
		err := dec.Decode(&er)
		if err != nil {
			return err
		}
		e.err = er
	case ErrorGo:
		var er GoError
		err := dec.Decode(&er)
		if err != nil {
			return err
		}
		e.err = er
	default:
		return errors.New("protocol error")
	}
	err = dec.Decode(&e.args)
	if err != nil {
		return err
	}
	err = dec.Decode(&e.pkg)
	if err != nil {
		return err
	}
	err = dec.Decode(&e.file)
	if err != nil {
		return err
	}
	err = dec.Decode(&e.line)
	if err != nil {
		return err
	}
	err = dec.Decode(&e.debugInfo)
	if err != nil {
		return err
	}
	err = dec.Decode(&msg)
	if err != nil {
		return err
	}
	switch msg {
	case NextIsNill:
		return nil
	case Next:
		err = dec.Decode(&e.next)
		if err != nil {
			return err
		}
	default:
		return errors.New("protocol error")
	}
	return nil
}
1366632
func (c *ConfigTree) GobEncode() ([]byte, error) {
	//todo throw an error if not frozen
	w := new(bytes.Buffer)
	encoder := gob.NewEncoder(w)
	if c.root == nil {
		c.root = &node{}
		// c.root.setKeys([]string{})
	}
	if err := encoder.Encode(c.root); err != nil {
		return nil, err
	}
	return w.Bytes(), nil
}
1020691
func (b *BloomFilter) GobDecode(data []byte) error {
	buf := bytes.NewBuffer(data)
	_, err := b.ReadFrom(buf)

	return err
}