read in file to buffer