Commons IO
  1. Commons IO
  2. IO-329

FileUtils.writeLines uses unbuffered IO

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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

        Activity

        Vitalii Tymchyshyn created issue -
        Hide
        Gary Gregory added a comment -

        Committed revision 1343253.

        Show
        Gary Gregory added a comment - Committed revision 1343253.
        Gary Gregory made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.4 [ 12320769 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development