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

FileUtils.readFileToString() can immediately return empty string if file length is zero

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None

    Description

      If file.length() == 0, there is no point of doing extra work of opening and closing an input stream - we can return an empty string right away.

      Same applies for FileUtils.readFileToByteArray() and FileUtils.readLines().

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              weekens Viktor Isaev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: