But I understood it can skip more than are remaining in the source, but no more than was requested, right?
In one of the attached files, the first bad loop has requested == got (both 4,294,902,047). In the second time in the loop (and every one thereafter), requested == 4,294,902,047, got == 4,294,967,296.
Ugh. Overflow...total needs to be long.
With more testing, it is possible for FileInputStream to allege that it skipped 20k bytes on a 10k byte file as the javadocs warn.