pub fn write_to_bytes( packet: &Packet, exact_lengths: bool, ) -> Result<Vec<u8>, Error<'static>>
Write a packet to a vec of bytes