8303260: (fc) FileChannel::transferFrom should support position > size()

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2023-04-04 15:57:56 +00:00
parent 3ef834fc6f
commit 7baccd9ee2
3 changed files with 176 additions and 13 deletions

View file

@ -935,8 +935,6 @@ public class FileChannelImpl
throw new NonWritableChannelException();
if ((position < 0) || (count < 0))
throw new IllegalArgumentException();
if (position > size())
return 0;
// System calls supporting fast transfers might not work on files
// which advertise zero size such as those in Linux /proc