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

@ -23,6 +23,8 @@
package java.lang;
import jdk.internal.util.DecimalDigits;
/**
* A helper class to get access to package-private members
*/
@ -117,11 +119,17 @@ public class Helper {
}
public static int getChars(int i, int begin, int end, byte[] value) {
return StringUTF16.getChars(i, begin, end, value);
StringUTF16.checkBoundsBeginEnd(begin, end, value);
int pos = DecimalDigits.getCharsUTF16(i, end, value);
assert begin == pos;
return pos;
}
public static int getChars(long l, int begin, int end, byte[] value) {
return StringUTF16.getChars(l, begin, end, value);
StringUTF16.checkBoundsBeginEnd(begin, end, value);
int pos = DecimalDigits.getCharsUTF16(l, end, value);
assert begin == pos;
return pos;
}
public static boolean contentEquals(byte[] v1, byte[] v2, int len) {