code: public void getChars(final int startIndex, final int endIndex, final char destination[], final int destinationIndex) {
          if (startIndex < 0) {
              throw new StringIndexOutOfBoundsException(startIndex);
          }
          if (endIndex < 0 || endIndex > length()) {
              throw new StringIndexOutOfBoundsException(endIndex);
          }
          if (startIndex > endIndex) {
              throw new StringIndexOutOfBoundsException("end < start");
          }
          System.arraycopy(buffer, startIndex, destination, destinationIndex, endIndex - startIndex);
      }
docs: Copies the character array into the specified array.
  
  @param startIndex  first index to copy, inclusive, must be valid
  @param endIndex  last index, exclusive, must be valid
  @param destination  the destination array, must not be null or too small
  @param destinationIndex  the index to start copying in destination
  @throws NullPointerException if the array is null
  @throws IndexOutOfBoundsException if any index is invalid