func PacketToBytes(w PacketWriter) []byte {
	b := bytes.NewBuffer(nil)
	if err := w.Write(b); err != nil {
		panic(err)
	}
	return b.Bytes()
}
// PacketToBytes will convert a packet to a byte slice.
PacketToBytes will convert a packet to a byte slice.
// PacketToBytes will convert a packet to a byte slice .
func PacketToBytes(w PacketWriter) []byte {
	b := bytes.NewBuffer(nil)
	if err := w.Write(b); err != nil {
		panic(err)
	}
	return b.Bytes()
}
func PacketToBytes ( w PacketWriter ) [ ] byte { b := bytes . NewBuffer ( nil ) if err := w . Write ( b ) ; err != nil { panic ( err ) } return b . Bytes ( ) }
PacketToBytes will convert a packet to a byte slice.
PacketToBytes will convert a packet to a byte slice .