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 13:42:25 UTC 2014


On Thu, Dec 4, 2014 at 1:00 AM, Brian Burkhalter
<brian.burkhalter at oracle.com> wrote:
> Similarly duplicate() and slice() invoked on a ByteBuffer return a
> ByteBuffer with byte order BIG_ENDIAN, whereas these methods invoked on an
> XBuffer (where X != Byte) return an XBuffer with the same byte order as the
> XBuffer object on which they were invoked.
>
[...]

Ouch!

Longstanding bug or design decision? I'd rather say the former, but
I'll certainly keep that in mind when I use these methods!

-- 
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