Map<Byte, EventMessage> serialisedUpdatesByProtocolVersion = new HashMap<Byte, EventMessage>();
long updateId = heapState.getNextUpdateId();
for (Byte version : protocolVersions) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
CougarObjectOutput out = objectIOFactory.newCougarObjectOutput(baos, version);
out.writeObject(new HeapDelta(heapState.getHeapId(), updateId, updatesThisBatch));
out.flush();
serialisedUpdatesByProtocolVersion.put(version, new EventMessage(baos.toByteArray()));
}
// now write these out for each session
for (IoSession session : heapState.getSessions()) {