This issue tracks a number of bugs with FileChannel.transferTo/transerFrom that arise when the source or target channel is closed, or the thread is interrupted. More specifically:
- The direct implementations operate on the raw FD and don't prevent the target/source channel from being closed during the transfer.
- The transferTo/transferFrom methods are specified to throw ClosedByInterruptException after closing both channels. This is implemented inconsistently, and leaves one channel open in several cases.
- The direct implementations operate on the raw FD and don't prevent the target/source channel from being closed during the transfer.
- The transferTo/transferFrom methods are specified to throw ClosedByInterruptException after closing both channels. This is implemented inconsistently, and leaves one channel open in several cases.