Allow for file size being an exact multiple of the buffer size. The read will return -1 after whole file is read.