code: public char[] getRawCharacters(int beginIndex, int endIndex) {
          int length = endIndex - beginIndex;
          char[] chars = new char[length];
          System.arraycopy(buf, beginIndex, chars, 0, length);
          return chars;
      }
docs: Returns a copy of a character array subset of the input buffer.
  The returned array begins at the {@code beginIndex} and
  extends to the character at index {@code endIndex - 1}.
  Thus the length of the substring is {@code endIndex-beginIndex}.
  This behavior is like
  {@code String.substring(beginIndex, endIndex)}.
  Unicode escape sequences are not translated.
  
  @param beginIndex the beginning index, inclusive.
  @param endIndex the ending index, exclusive.
  @throws ArrayIndexOutOfBoundsException if either offset is outside of the
  array bounds