Force the data of an output stream out to the underlying storage. That is, ensure that
it has been made persistent. If the database is to be transient, that is, if the database
does not survive a restart, then the sync method implementation need not do anything.
stream - The stream to be synchronized.
metaData - If true then this method must force both changes to the file's
contents and metadata to be written to storage; if false, it need only force file content changes
to be written. The implementation is allowed to ignore this parameter and always force out
java.io.IOException - if an I/O error occurs.
java.io.SyncFailedException - Thrown when the buffers cannot be flushed,
or because the system cannot guarantee that all the buffers have been
synchronized with physical media.
This method tests whether the StorageRandomAccessFile "rws" and "rwd" modes
are implemented. If the "rws" and "rwd" modes are supported then the database
engine will conclude that the write methods of "rws"/"rwd" mode
StorageRandomAccessFiles are slow but the sync method is fast and optimize
true if an StIRandomAccess file opened with "rws" or "rwd" modes immediately writes data to the
underlying storage, false if not.