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

(bf) Add absolute bulk put and get methods

    XMLWordPrintable

Details

    • b09
    • generic
    • 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

              bpb Brian Burkhalter
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: