mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8260273: DataOutputStream writeChars optimization
Reviewed-by: rriggs, bpb, alanb
This commit is contained in:
parent
535c2927b6
commit
c52c6c66db
2 changed files with 4 additions and 3 deletions
|
@ -300,8 +300,9 @@ public class DataOutputStream extends FilterOutputStream implements DataOutput {
|
|||
int len = s.length();
|
||||
for (int i = 0 ; i < len ; i++) {
|
||||
int v = s.charAt(i);
|
||||
out.write((v >>> 8) & 0xFF);
|
||||
out.write((v >>> 0) & 0xFF);
|
||||
writeBuffer[0] = (byte)(v >>> 8);
|
||||
writeBuffer[1] = (byte)(v >>> 0);
|
||||
out.write(writeBuffer, 0, 2);
|
||||
}
|
||||
incCount(len * 2);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue