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

EndianUtils.readSwappedUnsignedInteger() may return a negative number

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.1
    • 1.3.2
    • None
    • None

    Description

      Methods about reading unsigned-integer in class EndianUtils may return a negative number, due to casting int to long.
      Calculations with operator & etc. are under integer in these methods so its results are integer,
      then implicit casting the results to long keeps its positive/negative sign.

      Attachments

        1. EndianUtilsTest.java
          0.7 kB
          Hiroshi Ikeda
        2. IO-117.patch
          2 kB
          Henri Yandell

        Activity

          People

            Unassigned Unassigned
            ikeda Hiroshi Ikeda
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: