Commons IO
  1. Commons IO
  2. IO-311

IOUtils.read(InputStream/Reader) ignores the offset parameter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2
    • Component/s: Utilities
    • Labels:
      None

      Description

      IOUtils.read(InputStream input, byte[] buffer, int offset, int length) and
      read(Reader input, char[] buffer, int offset, int length) don't take the
      offset parameter into account...

      1. IO-311.patch
        2 kB
        Robert Muir

        Issue Links

          Activity

          Hide
          Michael McCandless added a comment -

          Maybe this bug should be fixed before releasing 2.2? It's fairly nasty.

          When used this method (readFully) in Lucene, the bug (completely ignoring the offset parameter) caused immediate failures in our tests.

          Also, this is new code in 2.2 I think? I see one other readFully in 2.1 (in SwappedDataInputStream), and it looks correct (respects the incoming offset).

          Show
          Michael McCandless added a comment - Maybe this bug should be fixed before releasing 2.2? It's fairly nasty. When used this method (readFully) in Lucene, the bug (completely ignoring the offset parameter) caused immediate failures in our tests. Also, this is new code in 2.2 I think? I see one other readFully in 2.1 (in SwappedDataInputStream), and it looks correct (respects the incoming offset).
          Hide
          Sebb added a comment -

          Thanks!

          Show
          Sebb added a comment - Thanks!
          Hide
          Gary Gregory added a comment -

          Version 2.2 has been released and addresses this issue.

          Show
          Gary Gregory added a comment - Version 2.2 has been released and addresses this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Robert Muir
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development