RFR: 8325340: Add ASCII fast-path to Data-/ObjectInputStream.readUTF

Brian Burkhalter bpb at openjdk.org
Wed Feb 14 20:07:05 UTC 2024


On Wed, 14 Feb 2024 10:41:08 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> Adding a fast-path for ASCII-only modified UTF-8 strings deserialied via Data- and ObjectInputStream
>> 
>> Testing: tier1-3
>
> src/java.base/share/classes/java/io/DataInputStream.java line 585:
> 
>> 583:         DataInputStream dis = null;
>> 584:         if (in instanceof DataInputStream) {
>> 585:             dis = (DataInputStream)in;
> 
> I guess that not making use of `instanceof` pattern matching is to enable backporting before JDK 16?

I have the same question here.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17734#discussion_r1489994945


More information about the nio-dev mailing list