airlift/slice — pull request #8 by stevenschlansker (2013-10-23 19:44:37+00:00)
Title: Ensure that Slice can only operate on native byte-order buffers

Currently, Slice is interoperable with `ByteBuffer` instances as long as the order matches. Slice uses `Unsafe` which is always native byte order, whereas `ByteBuffer` may be swapped.

The default `ByteBuffer` factories produce big endian buffers, whereas most users will be on little endian platforms. This is extremely surprising when all of your buffers are suddenly byte swapped!

Unfortunately this is a breaking change as all consumers will now have to specify a byte order. I am not sure if this is the best fix, maybe there is something that can be done which is less breaking...