RFR 9: 8065570: (bf spec) ByteBuffer.slice() should make it clear that the initial order is BIG_ENDIAN
Brian Burkhalter
brian.burkhalter at oracle.com
Thu Dec 4 19:27:55 UTC 2014
On Dec 4, 2014, at 6:09 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> I think you'll need to dig into inconsistencies before we add any clarifications to the javadoc.
I concur; I’ll try to run it down. I think in the end it will devolve to one of two outcomes:
1) only update the documentation to match the behavior, or
2) if the behavior is wrong, correct it and then update the documentation as needed.
> I assume any issues date back to JDK 1.4 but we need to check that. I don't have time to dig into myself just now but I believe the original intent was that all new buffers be created in BIG_ENDIAN and that view buffers are tied to whatever the order is of the byte buffer that they are created.
In ignorance of the original design intent, as a user I would naively expect the buffers returned by asReadOnlyBuffer(), duplicate(), and slice() to have the same byte order as the buffer on which the methods were invoked at the moment of invocation. I concur that the situation with respect to view buffers is however quite clear.
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20141204/219dfb8e/attachment.html>
More information about the nio-dev
mailing list