code: public int getEvent(int index) {
          if (events == null || index < 0 || index >= events.length) {
              throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "null" : events.length));
          }
  
          return events[index] & 0xFF;
      }
docs: getEvent -- get an event from the event log.
  @param index Index of the event
  @return Event ID