Summary
Update the specification of the relative bulk put
methods defined by the Buffer classes in java.nio
so that they specify the expected behavior when the backing array or memory of the source and destination buffers overlaps.
Problem
There is presently no description of the behavior expected when the method $TypeBuffer.put($TypeBuffer) is invoked with a buffer whose backing array or memory overlaps that of the buffer on which the method is invoked. The template placeholder $Type is one of {Byte, Char, Short, Int, Long, Float, Double} and is the same for both the destination buffer object and its source parameter.
Solution
Add a sentence describing the behavior expected when the backing array or memory of the parameter of $TypeBuffer.put($TypeBuffer) overlaps that of the target buffer.
Specification
Append this sentence to the last paragraph preceding the parameters specifications of $TypeBuffer.put($TypeBuffer):
If this buffer and the source buffer share the same backing array or memory, then the result will be as if the source elements were first copied to an intermediate location before being written into this buffer.
- csr of
-
JDK-8245121 (bf) XBuffer.put(Xbuffer src) can give unexpected result when storage overlaps
- Resolved
- relates to
-
JDK-8242500 (bf) MappedByteBuffer should clarify copying between overlapping mappings
- Closed