System.IO.IsolatedStorage.IsolatedStorageFileStream.Flush Method

Clears buffers for this stream and causes any buffered data to be written to the file.

Syntax

public override void Flush ()

Remarks

Because a buffer can be used for either reading or writing, but not both simultaneously, IsolatedStorageFileStream.Flush performs two functions. First, any data previously written to the buffer is copied to the file and the buffer is cleared. Second, if IsolatedStorageFileStream.CanSeek is true and data was previously copied from the file to the buffer for reading, the current position within the file is decremented by the number of unread bytes in the buffer. The buffer is then cleared.

Use the IsolatedStorageFileStream.Flush(bool) method overload when you want to ensure that all buffered data in intermediate file buffers is written to disk.

Requirements

Namespace: System.IO.IsolatedStorage
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0
Since: .NET 2.0