written function reading a file into array of bytes