Flush the bytes and write the data to disk