uses file data instead of input stream