Re:You’re better off using Exceptions
by waynecochran on Monday February 03, 2020 @05:06PM
(#22229780)
Simply count bytes as they are read. In the exception handler check to see if the count matches the expected value. Clean.
What happens if the file is smaller than you anticipate?
That's why exceptions aren't used for flow control.