Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IsolatedStorageFileStream.Flush Method

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

Namespace:  System.IO.IsolatedStorage
Assembly:  mscorlib (in mscorlib.dll)

public override void Flush()

Because a buffer can be used for either reading or writing, but not both simultaneously, Flush performs two functions. First, any data previously written to the buffer is copied to the file and the buffer is cleared. Second, if 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 Flush(Boolean) method overload when you want to ensure that all buffered data in intermediate file buffers is written to disk.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Show:
© 2015 Microsoft