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

EndianUtils.readSwappedUnsignedInteger() may return a negative number

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.2
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: