// Get number of events to write
int size = SessionStreamer.this.eventQueue.size();
// Write every event
for (int i = 0; i < size; i++) {
AbstractSessionEvent next = null;
try {
next = SessionStreamer.this.eventQueue.take();
} catch (InterruptedException e) {
//
}