Implement writing packet data to file