IsolatedStorageFileStream.Flush 方法

定义

清除此流的缓冲区,使得所有缓冲数据都写入到文件中。Clears buffers for this stream and causes any buffered data to be written to the file.

重载

Flush(Boolean)

清除此流的缓冲区,将所有缓冲数据都写入到文件中,并且也清除所有中间文件缓冲区。Clears buffers for this stream and causes any buffered data to be written to the file, and also clears all intermediate file buffers.

Flush()

清除此流的缓冲区,使得所有缓冲数据都写入到文件中。Clears buffers for this stream and causes any buffered data to be written to the file.

Flush(Boolean)

清除此流的缓冲区,将所有缓冲数据都写入到文件中,并且也清除所有中间文件缓冲区。Clears buffers for this stream and causes any buffered data to be written to the file, and also clears all intermediate file buffers.

public:
 override void Flush(bool flushToDisk);
public override void Flush (bool flushToDisk);
override this.Flush : bool -> unit
Public Overrides Sub Flush (flushToDisk As Boolean)

参数

flushToDisk
Boolean

如果刷新所有中间文件缓冲区,则为 true;否则为 falsetrue to flush all intermediate file buffers; otherwise, false.

注解

若要确保将中间文件缓冲区中的所有缓冲数据写入磁盘,请使用此重载。Use this overload when you want to ensure that all buffered data in intermediate file buffers is written to disk.

另请参阅

Flush()

清除此流的缓冲区,使得所有缓冲数据都写入到文件中。Clears buffers for this stream and causes any buffered data to be written to the file.

public:
 override void Flush();
public override void Flush ();
override this.Flush : unit -> unit
Public Overrides Sub Flush ()

注解

由于缓冲区可用于读取或写入(但不同时),因此 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. 第二种情况下,如果 CanSeek true 并且数据以前已从文件复制到缓冲区进行读取,则文件中的当前位置将按缓冲区中的未读字节数递减。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.

若要确保将中间文件缓冲区中的所有缓冲数据写入磁盘,请使用 Flush(Boolean) 方法重载。Use the Flush(Boolean) method overload when you want to ensure that all buffered data in intermediate file buffers is written to disk.

另请参阅

适用于