Java BufferedWriter close()

Posted by rakeshr on Stack Overflow See other posts from Stack Overflow or by rakeshr
Published on 2010-06-02T18:26:12Z Indexed on 2010/06/02 18:34 UTC
Read the original article Hit count: 312

Filed under:
|
|

Hi,

assume that I have the following code fragment

operation1();
bw.close();
operation2();

When I call BufferedReader.close() from my code, I am assuming my JVM makes a system call that ensures that the buffer has been flushed and written to disk. I want to know if close() waits for the system call to complete its operation or does it proceed to operation2() without waiting for close() to finish.

To rephrase my question, when I do operation2(), can I assume that bw.close() has completed successfully?

© Stack Overflow or respective owner

Related posts about java

Related posts about close