File should be opened in binary mode