RFR 9: 8065570: (bf spec) ByteBuffer.slice() should make it clear that the initial order is BIG_ENDIAN
Francis Galiegue
fgaliegue at gmail.com
Thu Dec 4 14:29:56 UTC 2014
Hello,
On Thu, Dec 4, 2014 at 3:09 PM, 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 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.
>
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.
--
Francis Galiegue, fgaliegue at gmail.com, https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)
More information about the nio-dev
mailing list