Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6701

org.apache.camel.util.IOHelper.loadText(InputStream) doesnt not return text as written

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.13.0
    • camel-core
    • None
    • Unknown

    Description

      This method does not return the text as written. If there is a text file WITHOUT a last \n this differs.
      The implementation in Camel reads line by line using a BufferedReader, so it cant know if there is a \n at the last line.
      The implementation of commons-io uses a StringWriter where it copies all bytes into.
      https://svn.apache.org/repos/asf/commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java

      Attachments

        1. IOHelperTest.java
          1 kB
          Jan Materne

        Activity

          People

            davsclaus Claus Ibsen
            jhm Jan Materne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: