public static IntsRef toUTF32(CharSequence s,IntsRefBuilder scratch){
  int charIdx=0;
  int intIdx=0;
  final int charLimit=s.length();
  while (charIdx < charLimit) {
    scratch.grow(intIdx + 1);
    final int utf32=Character.codePointAt(s,charIdx);
    scratch.setIntAt(intIdx,utf32);
    charIdx+=Character.charCount(utf32);
    intIdx++;
  }
  scratch.setLength(intIdx);
  return scratch.get();
}

public static IntsRef toUTF32 ( CharSequence s , IntsRefBuilder scratch ) { int charIdx = 0 ; int intIdx = 0 ; final int charLimit = s . length ( ) ; while ( charIdx < charLimit ) { scratch . grow ( intIdx + 1 ) ; final int utf32 = Character . codePointAt ( s , charIdx ) ; scratch . setIntAt ( intIdx , utf32 ) ; charIdx += Character . charCount ( utf32 ) ; intIdx ++ ; } scratch . setLength ( intIdx ) ; return scratch . get ( ) ; }
decodes the unicode codepoints from the provided charsequence and places them in the provided scratch intsref , which must not be null , returning it .
