peter-lawrey / Java-Chronicle

Java Indexed Record Chronicle
1.22k stars 193 forks source link

IndexedChronicle.createDataBuffer() ignores specified ByteOrder #32

Open agaluzzi opened 11 years ago

agaluzzi commented 11 years ago

The constructor for IndexedChronicle accepts a ByteOrder, which is used in createIndexBuffer(). However, it is not used in createDataBuffer() and the native byte ordering is always used instead:

line 246: mbb.order(ByteOrder.nativeOrder());

It would seem as though the purpose for specifying a byte ordering would be more for the data buffer, such that methods like writeInt() and writeLong() could be called on the writing excerpt and then read( byte[] ) could be used on the reading excerpt with an expected byte ordering.

version: 1.7.2

peter-lawrey commented 11 years ago

You are right that it should handle this consistently. In the next major release the plan is to only support the native ordering esp as Unsafe only supports native ordering. Unless you have a specific use case for big endian, I would deprecate the setting of the byte order.