Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-329

FileUtils.writeLines uses unbuffered IO

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: Streams/Writers
    • Labels:
      None

      Description

      FileUtils.writeLines looks like next:

      out = openOutputStream(file, append);
      IOUtils.writeLines(lines, lineEnding, out, encoding);

      openOutputStream opens plain FileOutputStream without any buffering and IOUtils.writeLines does not add abyt buffering. This means each line require 2 write syscalls (one for the line and one for line separator). This makes call very slow, especially for short lines

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tivv Vitalii Tymchyshyn
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: