Note that this form of the API does not necessarily overwrite the entire contents of
the file. If you are writing less data than was previously stored in the snapshot, the
excess data will remain. Use
writeBytes(byte[]) to fully overwrite the file.