added convenience methods to read a file as a whole