mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8283325: US_ASCII decoder relies on String.decodeASCII being exhaustive
Reviewed-by: rriggs, dcubed
This commit is contained in:
parent
b004fb0550
commit
002e366744
2 changed files with 61 additions and 0 deletions
|
@ -1032,6 +1032,12 @@ public final class String
|
|||
/* package-private */
|
||||
static int decodeASCII(byte[] sa, int sp, char[] da, int dp, int len) {
|
||||
int count = StringCoding.countPositives(sa, sp, len);
|
||||
while (count < len) {
|
||||
if (sa[sp + count] < 0) {
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
StringLatin1.inflate(sa, sp, da, dp, count);
|
||||
return count;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue