out.close();
baos.close();
DataInputStream in = new DataInputStream(new ByteArrayInputStream(data));
IterationEventWithAggregators newEvent = event.getClass().newInstance();
newEvent.read(new InputViewDataInputStreamWrapper(in));
in.close();
return newEvent;
} catch (Exception e) {
System.err.println(e.getMessage());