add comment

This commit is contained in:
parrt 2017-01-29 10:41:01 -08:00
parent 37adfd4e30
commit 03470b0083
1 changed files with 5 additions and 0 deletions

View File

@ -272,6 +272,11 @@ public class IntegerList {
_data = Arrays.copyOf(_data, newLength);
}
/** Convert the list to a UTF-16 encoded char array. If all values are less
* than the 0xFFFF 16-bit code point limit then this is just a char array
* of 16-bit char as usual. For values in the supplementary range, encode
* them as two UTF-16 code units.
*/
public final char[] toCharArray() {
// Optimize for the common case (all data values are
// < 0xFFFF) to avoid an extra scan