code: public void setEvent(int index, int event) {
          if (events == null || index < 0 || index >= events.length) {
              throw new IndexOutOfBoundsException("index = " + index + ", limit = " + (events == null ? "null" : events.length));
          }
  
          events[index] = (byte)event;
      }
docs: setEvent -- store an event number in the event log
  @param index Event position
  @param event Event ID