0

I want to use apache common-io package, but I am not sure whether there are any buffer strategies in the write/read functions.
For example, in FileUtil class there are functions like

    static void write(File file, CharSequence data);

If every call to these functions follows open->read/write->close, the efficiency will be low. I believe there must be some buffering strategies, right?

cheng

cheng
  • 2,106
  • 6
  • 28
  • 36

1 Answers1

1

It doesn't cache the open files or you might risk running out of file handles, or failing to rename/delete files because they are open.

It uses some buffering but when write() returns you can expect the file to be closed.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130