8219014: (bf) Add absolute bulk put methods which accept a source Buffer
Brian Burkhalter
brian.burkhalter at oracle.com
Wed Jan 29 23:49:46 UTC 2020
Please consider this prototype fix [1] for [2]. The other potential method
$Type$Buffer put(int index, $Type$Buffer src) {}
mentioned in the issue description is not included here so as to avoid mixing relative bulk (for src) and absolute bulk (for this) operations, i.e., not having either buffer change state. The proposed method therefore simply is the equivalent of replacing the array parameter $type$[] of $Type$Buffer.put(int, $type$[], int, int) with a $Type$Buffer.
More performant implementations specific to heap and direct buffers are intentionally omitted at this time but will be added later if this concept moves forward.
One potentially problematic behavior in the proposed method is allowing overlapping source and target ranges when the source and target buffers are the same buffer.
Thanks,
Brian
[1] http://cr.openjdk.java.net/~bpb/8219014/webrev.00/
[2] https://bugs.openjdk.java.net/browse/JDK-8219014
More information about the nio-dev
mailing list