OutputStream.Flush Method

Definition

Flushes this output stream and forces any buffered output bytes to be written out.

[Android.Runtime.Register("flush", "()V", "GetFlushHandler")]
public virtual void Flush ();
[<Android.Runtime.Register("flush", "()V", "GetFlushHandler")>]
abstract member Flush : unit -> unit
override this.Flush : unit -> unit

Implements

Attributes

Exceptions

if an error occurs while flushing this stream.

Remarks

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

The flush method of OutputStream does nothing.

Java documentation for java.io.OutputStream.flush().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to