Commons IO
  1. Commons IO
  2. IO-117

EndianUtils.readSwappedUnsignedInteger() may return a negative number

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.

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

        Activity

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development