8343925: [BACKOUT] JDK-8342650 Move getChars to DecimalDigits

Reviewed-by: jpai, alanb, liach
This commit is contained in:
Shaojin Wen 2024-11-11 15:14:10 +00:00
parent 0759224edc
commit b0a371b085
12 changed files with 376 additions and 405 deletions

View file

@ -462,11 +462,11 @@ public final class Long extends Number
int size = DecimalDigits.stringSize(i);
if (COMPACT_STRINGS) {
byte[] buf = new byte[size];
DecimalDigits.getCharsLatin1(i, size, buf);
StringLatin1.getChars(i, size, buf);
return new String(buf, LATIN1);
} else {
byte[] buf = new byte[size * 2];
DecimalDigits.getCharsUTF16(i, size, buf);
StringUTF16.getChars(i, size, buf);
return new String(buf, UTF16);
}
}