os.flush();
os.close();
LOG.info("Serialized event to byte array"
+ ", eventType=" + historyEvent.getEventType()
+ ", bufLen=" + os.toByteArray().length);
SummaryEventProto summaryEventProto =
SummaryEventProto.parseDelimitedFrom(
new ByteArrayInputStream(os.toByteArray()));
deserializedEvent = ReflectionUtils.createClazzInstance(
event.getClass().getName());
((SummaryEvent)deserializedEvent).fromSummaryProtoStream(summaryEventProto);