Write data in binary mode