RFR: 8300979: Lazily initialize (byte, char)arr in java.io.DataInputStream

Eirik Bjorsnos duke at openjdk.org
Tue Mar 21 17:30:40 UTC 2023


On Tue, 21 Mar 2023 15:41:13 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposed to lazily initialize the scratch arrays only if/when needed.

Looks like `DataInputStream.readUTF` could benefit from using `JavaLangAccess.countPositives` and return early for the common case that all bytes are ASCII. Food for another PR?

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

PR Comment: https://git.openjdk.org/jdk/pull/13121#issuecomment-1478310588


More information about the core-libs-dev mailing list