RFR: 8279283 - BufferedInputStream should override transferTo [v5]
Markus KARG
duke at openjdk.org
Mon Sep 5 16:15:35 UTC 2022
On Wed, 12 Jan 2022 13:24:12 GMT, Daniel Fuchs <dfuchs 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 501:
>
>> 499: return avail + getInIfOpen().transferTo(out);
>> 500: }
>> 501:
>
> Hi Markus, did you double check with all the existing subclasses of `BufferedInputStream` that the new implementation of `transferTo` will not cause trouble, if any of the subclasses is overriding `int read(byte[] b, int off, int len)`? If I'm not mistaken - with this new implementation of `transferTo` then `BufferedInputStream::read(byte[] b, int off, int len)` (a public method that can be overridden) will no longer be called by `transferTo`. This could be causing problems if `read` is overriden to do some special processing in the subclass.
Thank you, good catch! I will check the subclasses contained in OpenJDK! 👍
-------------
PR: https://git.openjdk.org/jdk/pull/6935
More information about the core-libs-dev
mailing list