RFR 9: 8065570: (bf spec) ByteBuffer.slice() should make it clear that the initial order is BIG_ENDIAN

Alan Bateman Alan.Bateman at oracle.com
Thu Dec 4 14:35:50 UTC 2014


On 04/12/2014 14:29, Francis Galiegue wrote:
> :
> While the docs indeed say so (you have to do "back to back" reads but
> whatever), the problem is that it violates the principle of least
> surprise; especially since the .as*Buffer() "conversions" don't alter
> the order at all.
>
> I do agree that it should be better documented.
>
Hopefully Brian can dig into the history. I don't think there should be 
any question mark over the view buffers as the spec is clear on that:

    "The byte order of a view buffer is fixed to be that of its byte 
buffer at the time that the view is created."

It's not as obvious for some of the methods that create new buffers.

-Alan.





More information about the nio-dev mailing list