RFR: 8279283 - BufferedInputStream should override transferTo [v5]

Markus KARG duke at openjdk.org
Mon Sep 5 16:08:04 UTC 2022


On Thu, 7 Jul 2022 07:34:32 GMT, Сергей Цыпанов <duke at openjdk.org> wrote:

>> Markus KARG has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fixed missing BufferedInputStream
>
> src/java.base/share/classes/java/io/BufferedInputStream.java line 495:
> 
>> 493:         int avail = count - pos;
>> 494:         if (avail > 0) {
>> 495:             out.write(buf, pos, avail);
> 
> I think `buf` should not be accessed directly but via `getBufIfOpen()` because we need to throw IOE in case `this` is closed.

Thank you, good catch! I just fixed this in https://github.com/openjdk/jdk/pull/6935/commits/2c415d0c9c39cec372c1edb189ac140af2755fa4. 👍

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

PR: https://git.openjdk.org/jdk/pull/6935


More information about the core-libs-dev mailing list