RFR: 8279283 - BufferedInputStream should override transferTo [v7]
Daniel Fuchs
dfuchs at openjdk.org
Tue Sep 6 17:13:47 UTC 2022
On Tue, 6 Sep 2022 17:01:09 GMT, Markus KARG <duke at openjdk.org> wrote:
>>> @AlanBateman Async close leaves BIS in an invalid state. The JavaDocs say ` The behavior for the case where the input and/or output stream is asynchronously closed, or the thread interrupted during the transfer, is highly input and output stream specific, and therefore not specified.`.
>>
>> Yes, I believe I suggested that wording when the method was added. The java.io APIs mostly pre-date deep consideration of those topics.
>>
>> I've looked at the update change to BIS in f2f9a904 and I think it's okay.
>>
>> On the CSR topic and your messages with Daniel. On the CSR wiki pages then phrase to look for is "behavioral compatibility". The "Kinds of Compatibility" has more details on the topic.
>
> Thank you all for your kind help and feedback.
>
> @AlanBateman So is now the time to switch this PR from Draft to Ready?
The source changes LGTM. I suppose you should now revert the changes above (in `HexPrinter.java`), otherwise the bytes will now be counted twice :-).
Which BTW shows that you would be depending on undocumented behavior whatever you do:
`transferTo` is not documented to call `this.read(...)`, but neither is it documented to **not call** `this.read(...)`... Hyrum's law wins here ;-)
-------------
PR: https://git.openjdk.org/jdk/pull/6935
More information about the core-libs-dev
mailing list