RFR: 8279283 - BufferedInputStream should override transferTo [v10]

Markus KARG duke at openjdk.org
Fri Sep 9 06:48:46 UTC 2022


On Fri, 9 Sep 2022 06:36:54 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Markus KARG has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - testing transferTo() when mark was set
>>  - testing transferTo() when buffer is non-empty
>
> test/jdk/java/io/BufferedInputStream/TransferTo.java line 170:
> 
>> 168:             if (mark) {
>> 169:               in.mark(1);
>> 170:             }
> 
> This just tests transferTo with a mark set, it doesn't appear to check that mark is respected. To test mark/reset then I think it will need to call mark with a largish readLimit, transferTo to drain the input to EOF, reset, and then read or transferTo again to check that the bytes from the mark are replayed.

I did not do that so far, as we agreed to check the *new* code path, which is only executed when noting was marked (so reset plays no role). Certainly I will be happy to add another test for the use case you describe (i. e. the *old* code path), even if we all know -thanks to our knowledge of the existence of the two code paths-, that it will surely pass even with my PR in place, unless there is a bug in the *old* code path... ;-)

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

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


More information about the core-libs-dev mailing list