Javatpoint Logo
Javatpoint Logo

Java OutputStream flush() Method

The flush() method of OutputStream class is used to flush the content of the buffer to the output stream. A buffer is a portion in memory that is used to store a stream of data(characters). That data sometimes will only get sent to an output device, when the buffer is full.

The flush method of OutputStream does nothing.

Syntax

Specified By:

flush in interface Flushable

Throws:

IOException- If an I/O error occurs.

Example

Output:

A
Next TopicJava OutputStream





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA