Dave Tolls wrote:That code will occasionally fail.
It's a common mistake I've seen, but the while clause should be:
If you use the current '> 0' it is possible for the reader to pick up 0 bytes on a read (for example, something else is using the disk at the time). '0' does not mean EOF, -1 does.
Oh thanks for this, will be sure to make amends to the practice.
Also, thanks for the feed back. Helped clear up the assembled concept I had in my head for what was going on in the code.
I suppose it was mostly confirmation I was looking for but without a doubt I'll have to keep things like that FileChannel transfer methods in mind too when revising this code.