func (pkt *ConnAckPacket) WriteTo(w io.Writer, version byte) (n int, err error) {
	var d int
	n, err = pkt.header.WriteTo(w)
	if err != nil {
		return
	}
	var sp byte = 0x00
	if pkt.SessionPresent {
		sp = 0x01
	}
	d, err = w.Write([]byte{sp, byte(pkt.Code)})
	n += d
	return
}
// WriteTo writes the packet to the io.Writer.
WriteTo writes the packet to the io.Writer.
// WriteTo writes the packet to the io . Writer .
func (pkt *ConnAckPacket) WriteTo(w io.Writer, version byte) (n int, err error) {
	var d int
	n, err = pkt.header.WriteTo(w)
	if err != nil {
		return
	}
	var sp byte = 0x00
	if pkt.SessionPresent {
		sp = 0x01
	}
	d, err = w.Write([]byte{sp, byte(pkt.Code)})
	n += d
	return
}
func ( pkt * ConnAckPacket ) WriteTo ( w io . Writer , version byte ) ( n int , err error ) { var d int n , err = pkt . header . WriteTo ( w ) if err != nil { return } var sp byte = 0x00 if pkt . SessionPresent { sp = 0x01 } d , err = w . Write ( [ ] byte { sp , byte ( pkt . Code ) } ) n += d return }
WriteTo writes the packet to the io.Writer.
WriteTo writes the packet to the io . Writer .