Added a convenience method for writing data to a file on the storage.