Modified readFrame() method to support binary files that contain NULL characters.