code: public void setCurrentIndex(int index) {
  
      // yes, index == getLength() is allowed - that is the state when the end is reached and
      // setCurrentIndex(getCurrentPosition()) should NOT cause an exception...
      if ((index < 0) || (index > getLength())) {
        throw new IndexOutOfBoundsException(Integer.toString(index));
      }
      this.offset = this.initialOffset + index;
    }
docs: This method sets the {@link #getCurrentIndex() current index}.
  
  @param index is the next index position to set. The value has to be greater or equal to {@code 0} and
  less or equal to {@link #getLength()} .