// WriteTo satifies io.WriterTo interface. TypeId is not encoded.
485913
func (l *List) WriteTo(w io.Writer) (n int64, err error) {
	var nn int64

	// Write TagType prefix
	tt := types.Int8(l.Typ)
	if nn, err = tt.WriteTo(w); err != nil {
		return
	}
	n += nn

	length := types.Int32(len(l.Value))
	if nn, err = length.WriteTo(w); err != nil {
		return
	}
	n += nn

	for _, tag := range l.Value {
		if nn, err = tag.WriteTo(w); err != nil {
			return
		}
		n += nn
	}

	return
}
149550
func (c *Conn) WriteTo(b []byte, addr net.Addr) (int, error) {
	return c.p.WriteTo(b, addr)
}
294999
func (e *End) WriteTo(w io.Writer) (n int64, err error) {
	var tid byte

	err = binary.Write(w, binary.BigEndian, &tid)
	if err != nil {
		return
	}
	n = 1
	return
}
202996
func (a *ActionSetQueue) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, action{a.Type(), actionLen}, a.QueueID)
}
435102
func (s *String) WriteTo(w io.Writer) (n int64, err error) {
	// unsigned short, can't use Short
	var length = uint16(len(s.Value))
	err = binary.Write(w, binary.BigEndian, &length)
	if err != nil {
		return
	}

	// Then write string bytes
	_, err = w.Write([]byte(s.Value))
	if err != nil {
		return
	}
	n += int64(length)

	return
}
1356526
func (i Int32) WriteTo(w Writer) error {
	arr := [4]byte{byte(i), byte(i >> 8), byte(i >> 16), byte(i >> 24)}
	_, err := w.Write(arr[:])
	return errorsp.WithStacks(err)
}
1172198
func (sel *selector) WriteTo(w io.Writer) (int64, error) {
	return sel.writeTo(w, nil)
}
783158
func (dec *declaration) WriteTo(w io.Writer) (int64, error) {
	return dec.writeTo(w, nil)
}
249124
func (t *TablePropApplySetField) WriteTo(w io.Writer) (int64, error) {
	return writeTablePropXM(w, t, t.Fields)
}
1050882
func (m *MultipartRequest) WriteTo(w io.Writer) (int64, error) {
	// By default, body will be embedded into the reader type.
	return encoding.WriteTo(w, m.Type, m.Flags, pad4{}, m.Body)
}
894889
func (d *Description) WriteTo(w io.Writer) (int64, error) {
	mfr := d.copyTo(d.Manufacturer, descLen)
	hw := d.copyTo(d.Hardware, descLen)
	sw := d.copyTo(d.Software, descLen)
	sn := d.copyTo(d.SerialNum, serialNumLen)
	dp := d.copyTo(d.Datapath, descLen)

	return encoding.WriteTo(w, mfr, hw, sw, sn, dp)
}
721233
func (h *Header) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, *h)
}
933461
func (isNull IsNull) WriteTo(w Writer) error {
	_, err := fmt.Fprintf(w, "%s IS NULL", w.Key(isNull[0]))
	return err
}
1235050
func (h DBHashes) writeTo(w io.Writer) error {
	return binary.Write(w, binary.LittleEndian, h)
}
796873
func (g *GroupMod) WriteTo(w io.Writer) (int64, error) {
	n, err := encoding.WriteTo(w, g.Command, g.Type, pad1{}, g.Group)
	if err != nil {
		return n, err
	}

	nn, err := encoding.WriteSliceTo(w, g.Buckets)
	return n + nn, err
}
1238957
func (p *PortStatsRequest) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, p.PortNo, pad4{})
}
23832
func (model *Model) WriteTo(w io.Writer) (int64, error) {
	model.RLock()
	defer model.RUnlock()
	b, err := json.Marshal(model)
	if err != nil {
		return 0, err
	}
	n, err := w.Write(b)
	if err != nil {
		return int64(n), err
	}
	return int64(n), nil
}