469,964 Members | 1,754 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

flush() function uses in java

kaleeswaran
132 100+
wat is use of flush() fun in java
Mar 27 '07 #1
7 23000
r035198x
13,262 8TB
wat is use of flush() fun in java
Be more specific. What flush fun are you talking about?
Mar 27 '07 #2
kaleeswaran
132 100+
i don't know much about this flush() function..
i hve seen it most of the java programs...
so i would like to know about this that's all....
"System.out.flush()"
Mar 28 '07 #3
r035198x
13,262 8TB
i don't know much about this flush() function..
i hve seen it most of the java programs...
so i would like to know about this that's all....
"System.out.flush()"
Read about it here .
Mar 28 '07 #4
Mainly in Java flush() is used to empty the buffer data between the server and the client.
Syntex for using this function is:

private DataOutputStream toServer;
toServer = new DataOutputStream(socket.getOutputStream());
double radius =5.0;
// Send the radius to the server
toServer.writeDouble(radius);
toServer.flush();
Oct 15 '10 #5
Thejas
1
@r035198x
In java There will a buffer.when u write data to file or console it will initiall write to buffer then to file or console

Untill we use flush() method it will not be written into destination(file or console) from buffer
Nov 3 '11 #6
Nicool
1
For performance issue, first data is to be written into Buffer. When buffer get full then data is written to output (File,console etc.). When buffer is partially filled and you want to send it to output(file,console) then you need to call flush() method manually in order to write partially filled buffer to output(file,console).
Nov 30 '11 #7
Thanks Ali Akram for your example.
Sep 20 '12 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Jon Spivey | last post: by
1 post views Thread by Victor Irzak | last post: by
reply views Thread by Jean Hagen | last post: by
30 posts views Thread by Jonathan Neill | last post: by
5 posts views Thread by Luiz Vianna | last post: by
1 post views Thread by Tom | last post: by
1 post views Thread by nitroamos | last post: by
12 posts views Thread by Daniel Kaplan | last post: by
2 posts views Thread by Damir | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.