private static void MonoHardFlush(System.IO.FileStream stream)
{
System.IO.MonoIOError result = System.IO.MonoIOError.ERROR_SUCCESS;
System.IO.MonoIO.Flush(stream.Handle, out result);
if (result != System.IO.MonoIOError.ERROR_SUCCESS)
{
throw new System.IO.IOException(string.Format("Flush call failed with error {0}.", result));
}
}