// WriteTo serializes a key store and writes it to a io.Writer,
// returning the number of bytes written and any errors encountered.
550884
func (s *Store) WriteTo(w io.Writer) (n int64, err error) {
	s.mtx.RLock()
	defer s.mtx.RUnlock()

	return s.writeTo(w)
}
313054
func (s HandshakeHeaderString) WriteTo(w io.Writer) (int64, error) {
	n, err := io.WriteString(w, string(s))
	return int64(n), err
}
249124
func (t *TablePropApplySetField) WriteTo(w io.Writer) (int64, error) {
	return writeTablePropXM(w, t, t.Fields)
}
933461
func (isNull IsNull) WriteTo(w Writer) error {
	_, err := fmt.Fprintf(w, "%s IS NULL", w.Key(isNull[0]))
	return err
}
598207
func (q *QueueGetConfigRequest) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, q.Port, pad4{})
}
339806
func (b *Buffer) WriteTo(w io.Writer) (int64, error) {
	version := b.preOp()
	n, err := b.buf.WriteTo(w)
	b.postOp(version)
	return n, err
}
1321204
func (t *TableMod) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, t.Table, pad3{}, t.Config)
}
839603
func (e *scriptEntry) WriteTo(w io.Writer) (n int64, err error) {
	var written int64

	// Write header
	if written, err = binaryWrite(w, binary.LittleEndian, scriptHeader); err != nil {
		return n + written, err
	}
	n += written

	// Write hash
	if written, err = binaryWrite(w, binary.LittleEndian, &e.scriptHash160); err != nil {
		return n + written, err
	}
	n += written

	// Write btcAddress
	written, err = e.script.WriteTo(w)
	n += written
	return n, err
}
743641
func (b *BucketCounter) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, b.PacketCount, b.ByteCount)
}
748362
func (er *EchoRequest) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, er.Data)
}
1124099
func (a *AggregateStats) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(
		w, a.PacketCount, a.ByteCount, a.FlowCount, pad4{})
}
1134628
func (b Blob) WriteTo(w io.Writer) (int64, error) {
	written, err := w.Write([]byte(b))
	return int64(written), err
}
75773
func (e *Error) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, e.Type, e.Code, e.Data)
}
888375
func (b *Bitmap) WriteTo(w io.Writer) (n int64, err error) {
	b.Optimize()
	return b.writeToUnoptimized(w)
}
58055
func (p *PortStatus) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, p.Reason, pad7{}, &p.Port)
}
125177
func (i Int) WriteTo(w io.Writer) (int64, error) {
	written, err := fmt.Fprintf(w, "%d", i)
	return int64(written), err
}
1276046
func (r *copyReader) WriteTo(w io.Writer) (int64, error) {
	if r.WriterTo == nil {
		return 0, nil
	}

	return r.WriterTo.WriteTo(w)
}