Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8152934

DataInput.readUnsignedInt addition

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE REQUEST :
      There are readUnsignedByte (returning short) and readUnsignedShort (returning int) methods in DataInput interface. However, there is no readUnsignedInt method (that would return long). This makes the interfaces inconsistent, because there is no any particular reason to not have such a method for int if there are methods for short and byte.

      JUSTIFICATION :
      Eliminates inconsistency in the interface, useful for reading data from stream.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      readUnsignedInt will use 4 lower bytes of long to store an unsigned value of int.
      ACTUAL -
      No such a method

      CUSTOMER SUBMITTED WORKAROUND :
      Use Integer.toUnsignedLong

            fyang Fei Yang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: