FileUtils: Fix incorrect usage of istream::read()