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

Alan Bateman Alan.Bateman at oracle.com
Wed Feb 13 20:04:43 UTC 2019


On 13/02/2019 01:36, Brian Burkhalter wrote:
> :
>
> I have revised the specifications of exceptions for the five methods 
> in question and updated the tests accordingly:
>
> http://cr.openjdk.java.net/~bpb/5029431/webrev.02/
>
> I have not yet updated the wording of the Buffer*flowException classes 
> to remove the restriction to relative operations. I can do that once 
> the rest looks good.
>
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.

-Alan


More information about the nio-dev mailing list