1

FileOutputStream.close is really slow when writing large file

I found reference to my question in the above link and one of the bloggers (Black Joker) had opinion that close operation on the outputstream does not guarantee that the contents are written to disk. Is that a fair or true statement ?

Community
  • 1
  • 1
AmeyK
  • 19
  • 1
  • Possible duplicate, with a good answer here http://stackoverflow.com/a/2732760/4793951 – Zircon May 04 '16 at 17:50
  • Possible duplicate of [In Java, when I call OutputStream.close() do I always need to call OutputStream.flush() before?](http://stackoverflow.com/questions/2732260/in-java-when-i-call-outputstream-close-do-i-always-need-to-call-outputstream) – Natecat May 04 '16 at 17:50
  • flush does not write the data to disk. From what i have researched, it will just send the data to OS buffers. So when i call close, does it really write the contents to the disk or it will just close the outputstream for any further use. – AmeyK May 04 '16 at 18:06
  • @AmeyK I think that's up to the operating system, not up to Java. – Louis Wasserman May 04 '16 at 18:32
  • Thanks Louis Wasserman – AmeyK May 04 '16 at 18:34

0 Answers0