DataInputStream readUTF related field initialization

Brian Burkhalter brian.burkhalter at oracle.com
Wed May 5 18:52:49 UTC 2021


> On May 5, 2021, at 11:09 AM, Robert Marcano <robert at marcanoonline.com> wrote:
> 
> 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?

Yes, this could help a bit with the footprint.

Brian


More information about the core-libs-dev mailing list