On Thu, 23 Mar 2023 19:27:04 GMT, Sergey Tsypanov <stsypa...@openjdk.org> wrote:
>> By default `BufferedInputStream` is constructed with internal buffer with >> capacity 8192. In some cases this buffer is never used, e.g. when we call >> `IS.readNBytes()` or `IS.readAllBytes()` (relying on `BIS.read1()`) or when >> `BufferedInputStream` is cascaded. > > Sergey Tsypanov has updated the pull request incrementally with one > additional commit since the last revision: > > Update src/java.base/share/classes/java/io/BufferedInputStream.java > > Co-authored-by: liach <7806504+li...@users.noreply.github.com> > You are probably following #13121, but for everybody else's reference here is > Alan's comment on that PR: > > [#13121 > (comment)](https://github.com/openjdk/jdk/pull/13121#issuecomment-1481127986) The lazy creation only happens if it's the exact BufferedInputStream class, which is already handled like the internal lock. ------------- PR Comment: https://git.openjdk.org/jdk/pull/13150#issuecomment-1481805918