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

(bf) Add absolute bulk put and get methods

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.2
    • Fix Version/s: 13
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b09
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: rmT116609 Date: 04/08/2004


      A DESCRIPTION OF THE REQUEST :
      The ByteBuffer class does not support the writing of byte arrays at to an absolute position within a ByteBuffer.

      JUSTIFICATION :
      - Completeness
      - Allows multiple threads to do efficient bulk updates to the same ByteBuffer.
      - Using slice() and duplicate() to get the same functionality will create a large amount of unwanted references to the oringial buffer. This makes it difficult to be certain that all references are set null to allow the MappedByteBuffer to be Garbage Collected. My application requires unmap functionality, which I have implemented using the Garbage Collector and Phantom References (due to no unmap method).

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      4 new methods added to the ByteBuffer class:

      public ByteBuffer get(int index, byte[] dst);
      public ByteBuffer get(int index, byte[] dst, int offset, int length);
      public ByteBuffer put(int index, byte[] src);
      public ByteBuffer put(int index, byte[] src, int offset, int length);
      ACTUAL -
      The bulk get and put methods should behave like the absolute primitive get/put methods, but efficently updating the Buffer.

      CUSTOMER SUBMITTED WORKAROUND :
      Using slice() and duplicate(), but this is not appropriate for my application.
      (Incident Review ID: 239468)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bpb Brian Burkhalter
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: