Add abstract write method to Packet.java.