5029431: (bf) Add absolute bulk put and get methods

Chris Hegarty chris.hegarty at oracle.com
Thu Feb 14 11:04:32 UTC 2019

> On 13 Feb 2019, at 22:15, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
>> On Feb 13, 2019, at 12:04 PM, Alan Bateman <Alan.Bateman at oracle.com <mailto:Alan.Bateman at oracle.com>> wrote:
>>> ...
>> I spent a bit of time going through the existing spec to get the various exception cases into my head. I think my concerns and suggestion to keep this consistent with the relative bulk get/set methods were incorrect and that IOOBE is actually the right exception. The methods that I think settle this debate is the absolute get/put methods defined by ByteBuffer for reading/writing primitive values. As an example getLong(index) throws IOOBE if the index is not smaller than the limit minus seven. Sorry for wasting your time on Buffer*flowException, they only come into the picture for methods that need to change the position.

It is certainly interesting to compare the exceptional behaviour of
these new absolute bulk methods to the existing absolute primitive
methods of ByteBuffer. I hadn't considered that. Somewhat because I
consider the new absolute bulk methods more closely aligned with the
relative bulk methods, but mostly because the primitive getter/setters
are ByteBuffer specific, while these new absolute bulk methods are
across all buffer types.

My preference is still for the previous webrev ( .02 ), for the reasons
stated above. But since I appear to be in the minority now, and
otherwise the changes are good ( and most welcome ), I don't object to
webrev .03.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190214/6880a4ab/attachment.html>

More information about the nio-dev mailing list