public Event next() throws IOException {

    Event event = eventStream.next();

    try {
      digest.update(event.toString().getBytes("UTF-8"));
    } catch (UnsupportedEncodingException e) {
      throw new IllegalStateException(e);
    }

    return event;
  }
 public boolean hasNext() throws IOException {
   return eventStream.hasNext();
 }