40 ms·
> don’t include logic for checking for EOF. Let the exception handler catch it where the file will be closed What happens if the file is smaller than you antic
by gwbas1c 7y ago
> don’t include logic for checking for EOF. Let the exception handler catch it where the file will be closed
What happens if the file is smaller than you anticipate?
That's why exceptions aren't used for flow control.
- waynecochran 7y agoSimply count bytes as they are read. In the exception handler check to see if the count matches the expected value. Clean.