packet.setMemoryUsage(count);
dataOut.write(data, 0, count);
}
protected synchronized final Packet readPacket(DataInput dataIn, PacketReader reader) throws IOException {
Packet packet = reader.createPacket();
int length = dataIn.readInt();
packet.setMemoryUsage(length);
byte[] data = new byte[length];
dataIn.readFully(data);
//then splat into the internal datainput
internalBytesIn.restart(data);
reader.buildPacket(packet, internalDataIn);