DataInputStream readUTF related field initialization

Robert Marcano robert at marcanoonline.com
Wed May 5 18:09:12 UTC 2021


Greetings. DataInputStream has some fields with the comment "working 
arrays initialized on demand by readUTF" but these fields are being 
initialized at object instantiation.

On the other hand DataOutputStream has one field with a likewise comment 
initialized to null.

I think DataInputStream could be optimized the same way as 
DataOutputStream and help in the memoty footprint of DataInputStream 
when used for other reads not related to readUTF.

Sounds reasonable?


More information about the core-libs-dev mailing list