public synchronized PacketWriter createPacket(char id) {
    PacketWriter writer = new PacketWriter();
    myLastMessageId++;
    writer.appendLong(myLastMessageId);
    writer.appendChar(id);
    return writer;
  }
public synchronized PacketWriter createPacket(char id)