public void writeData(DataOutputStream output) throws IOException { output.writeInt(id); output.writeShort(data); PacketUtil.writeString(output, name); }
public void readData(DataInputStream input) throws IOException { id = input.readInt(); data = input.readShort(); name = PacketUtil.readString(input); }
public int getNumBytes() { return 6 + PacketUtil.getNumBytes(name); }
@Override public void writeData(DataOutputStream output) throws IOException { super.writeData(output); PacketUtil.writeString(output, getUrl()); output.writeBoolean(isDrawingAlphaChannel()); }
@Override public void readData(DataInputStream input) throws IOException { super.readData(input); this.setUrl(PacketUtil.readString(input)); this.setDrawAlphaChannel(input.readBoolean()); }
@Override public int getNumBytes() { return super.getNumBytes() + PacketUtil.getNumBytes(getUrl()) + 1; }