8342650: Move getChars to DecimalDigits

Reviewed-by: liach
This commit is contained in:
Shaojin Wen 2024-11-11 05:06:56 +00:00
parent ca69a53b76
commit e1d684c645
12 changed files with 405 additions and 376 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];
StringLatin1.getChars(i, size, buf);
DecimalDigits.getCharsLatin1(i, size, buf);
return new String(buf, LATIN1);
} else {
byte[] buf = new byte[size * 2];
StringUTF16.getChars(i, size, buf);
DecimalDigits.getCharsUTF16(i, size, buf);
return new String(buf, UTF16);
}
}