Just a quick question, would it be relatively expensive to call peek() for every byte read in, to check for an upcoming EOF()? Because I need to know a byte in advance. Or should I just find the file size and do a test to see if the number of bytes read has reached that number?
I'm asking because I'm writing a Huffman/other compression codec module for potential use in future programs, and not all bits in the last byte of the file may be used.