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?
when I do operation2(), can I assume that bw.close() has completed successfully?
Yes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With