On Mon, 17 Oct 2022 10:59:21 GMT, Roman Kennke <rken...@openjdk.org> wrote:

> Which kind of sources would do that, and is there a way to check it and 
> prevent it?
> 
> The whole issue points to an insufficiency in the API: it is lacking a way to 
> transfer buffers in a read-only fashion (like NIO could do). I don't suppose 
> we would want to change that, though, right?

It can arise with many sources. One example is a program writing to a file and 
another reading from the same file and doing the equivalent of "tail -f". So 
yes, it is possible for transferTo to transfer >0 bytes after it a previous 
innovation has returned 0.

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

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

Reply via email to