Reputation: 6998
I have gone through the javadoc but I could't find anything.Does it buffer data internally? If yes, since there is no close/flush operation, how does it make sure all data has been written. If it does not buffer, Does it go to disk everytime call is made?
I looked at source code here, http://grepcode.com/file/repo1.maven.org/maven2/commons-io/commons-io/2.4/org/apache/commons/io/FileUtils.java#FileUtils.openOutputStream%28java.io.File%2Cboolean%29 and it does not seem to do any buffering. It opens a stream every time.
Upvotes: 0
Views: 2686
Reputation: 11006
From looking at the source, a new stream is created, the data is written out, and then the stream is closed.
Here's the link to the source I used to determine this. Eventually writeStringToFile
is called when you call write.
This makes sense as its a static method which returns nothing.
So, it doesn't buffer data internally. Every time you call write
data will be written to the file.
Upvotes: 5