-
Enhancement
-
Resolution: Fixed
-
P3
-
1.4.2
-
b09
-
generic
-
generic
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)
======================================================================
- csr for
-
JDK-8212619 (bf) Add absolute bulk put and get methods
- Closed
- duplicates
-
JDK-8011932 Missing absolute methods on nio ByteBuffer
- Closed
- relates to
-
JDK-5071718 (bf) Add ByteBuffer.slice(int index, int length)
- Resolved
-
JDK-8219014 (bf) Add absolute bulk put methods which accept a source Buffer
- Resolved
-
JDK-6174965 (bf) ByteBuffer would benefit from (optional) absolute bulk put()/get() methods)
- Closed
-
JDK-8180628 (bf) Retrofit direct buffer support for size beyond gigabyte scales
- Closed
- links to
-
Review openjdk/jdk11u-dev/2685