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

Missing absolute methods on nio ByteBuffer

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      A DESCRIPTION OF THE REQUEST :
      ByteBuffer has a range of absolute and relative put and get methods.

      However for some reason a number of ABSOLUTE methods have been left out for unknown reasons. Those ABSOLUTE methods that are missing are:

       put(int index, byte[] src)
       put(int index, byte[] src, int offset, int length)
       put(int index, ByteBuffer src)

       get(int index, byte[] dst)


      JUSTIFICATION :
      ByteBuffer is used in MappedByteBuffer. Here it often makes sense to use the absolute methods rather than the relative methods.

      The missing methods cannot be mimic'ed without resorting to things like looping and copying one byte at a time. (which is defeats the whole purpose of having bulk methods in the first place).



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Feature complete, i.e there should be absolute bulk get and put methods.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              alanb Alan Bateman
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: