is that if you allocate the size of the file to the buffer and then loop until the read method finds -1, then this will never happen because the EOF marker is in fact fc.size() + EOFMarkerLength. Your comments about a large also worry me a bit and make me want to reconsider the use of the first example. Would it be acceptable then to use this:
if the whole file is not read, -1 (or EOF) will never be reached.
For every complex problem, there is a solution that is simple, neat, and wrong.