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

(spec) {DataInput,RandomAccessFile}.readLong() documentation potentially confusing

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • 5.0
    • core-libs
    • Cause Known
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      1.4.2_11

      FULL OS VERSION :
      Not related to a specific OS

      A DESCRIPTION OF THE PROBLEM :
      The documentation of readLong() of RandomAccessFile as appears in http://java.sun.com/j2se/1.4.2/docs/api/java/io/RandomAccessFile.html#readLong() is incorrect.
      Specifically, if the bytes read are 0, 0, 0, 0, 0, 0, 0, CA (-54), the result, according to the documentation would be -54 and not 202.

      Note:
      1. The method readLong() works correctly - the result is 202.
      2. The documentation in DataInput.readLong() is different and involves OR operations between the bytes - as it should be.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Look in the following link:
      http://java.sun.com/j2se/1.4.2/docs/api/java/io/RandomAccessFile.html#readLong()


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: