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

(bf) ByteBuffer absolute put/get should make it clear that they do not change the position

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :
      1.8.0_121

      ADDITIONAL OS VERSION INFORMATION :
      10.11.6

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      n/a to documentation

      A DESCRIPTION OF THE PROBLEM :
      Documentation of class ByteBuffer is unclear on management of the "current position" pointer. Specifically, does a call to one of the absolute get or put methods cause this pointer to be updated or changed in any way?

      A clear statement of how this works should be included in the documentation. As far as I can tell, the current documentation is silent on this point.

      Also, it occurs to me that methods to read and set this pointer could have some use.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      read this:
      https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Learning how the current position pointer is managed
      ACTUAL -
      Puzzled

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Make all calls absolute(?)

      Attachments

        Activity

          People

            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: