Updates the underlying data source or repository with the current state of the buffer and then clears the buffer.
If a stream does not implement a buffer, this method will do nothing.
[Visual Basic] MustOverride Public Sub Flush() [C#] public abstract void Flush(); [C++] public: virtual void Flush() = 0; [JScript] public abstract function Flush();
Exception Type | Condition |
---|---|
IOException | An I/O error occurs. |
Because a buffer may be used for either reading or writing, but not both simultaneously, Flush might write to the underlying data source or repository any data previously written to the buffer, or Flush might clear the buffer, or both.