Esempio n. 1
0
 /**
  * Converts a range of a string to an array of code points.
  *
  * @param charSequence the source string.
  * @param startIndex the start index inside the string in java chars, inclusive.
  * @param endIndex the end index inside the string in java chars, exclusive.
  * @return a new array of code points. At most endIndex - startIndex, but possibly less.
  */
 public static int[] toCodePointArray(
     final CharSequence charSequence, final int startIndex, final int endIndex) {
   final int length = charSequence.length();
   if (length <= 0) {
     return EMPTY_CODEPOINTS;
   }
   final int[] codePoints = new int[Character.codePointCount(charSequence, startIndex, endIndex)];
   copyCodePointsAndReturnCodePointCount(
       codePoints, charSequence, startIndex, endIndex, false /* downCase */);
   return codePoints;
 }