code: func (b *base) WriteTo(w io.Writer) (int64, error) {
  	// Create a byte buffer.
  	var bf bytes.Buffer
  
  	// Write the Packet data to the buffer.
  	bf.Write(b.fixedHeader)
  	bf.Write(b.variableHeader)
  	bf.Write(b.payload)
  
  	// Write the buffered data to the writer.
  	n, err := w.Write(bf.Bytes())
  
  	// Return the result.
  	return int64(n), err
  }
docs: // WriteTo writes the Packet data to the writer.