code: public void visitAllEvents(SelectObjectContentEventVisitor visitor) throws SelectObjectContentEventException {
          Iterator<SelectObjectContentEvent> eventsIterator = getEventsIterator();
          while (eventsIterator.hasNext()) {
              eventsIterator.next().visit(visitor);
          }
      }
docs: Apply the provided {@link SelectObjectContentEventVisitor} to each {@link SelectObjectContentEvent} in this stream
  in the order they are returned by S3. This will lazily-load the events from S3, minimizing the amount of memory used.
  
  This will raise a runtime exception if {@link #getAllEvents()}, {@link #getRecordsInputStream()} or {@link #getEventsIterator()}
  have already been used.
  
  After using this method, you still must {@link #close()} this object to release the connection to S3.
  
  @param visitor The visitor that should be applied to each event in this stream.