ByteBuffer -> Packet conversion