Closed edhjer closed 7 months ago
Hi @edhjer. Thanks for flagging that.
As a workaround you could simply instantiate value as ByteBuffer counter = ByteBuffer.allocateDirect(Long.BYTES).order(ByteOrder.nativeOrder())
Though I agree that it's counterintuitive and seems more like a bug. Thus we will release a new ea
version soon that has it fixed.
When upgrading from
net.openhft:chronicle-map:3.24ea3
->net.openhft:chronicle-map:3.24ea4
I noticed an issue reading the values from myChronicleMap<ByteBuffer,ByteBuffer>
instance.basic repro case below:
We can see in the newer version the value read from
counter
is72057594037927936
instead of1
...digging in I came across this change which introduces a callbb.order(ByteOrder.nativeOrder())
that seems to modify the byte order on the buffer - in this case fromBIG_ENDIAN
->LITTLE_ENDIAN
I believe.I'm curious if this change in the Chronicle-Bytes library is trying to get us to tweak our use of
ChronicleMap
, perhaps to use theBytes
object instead ofByteBuffer
?Appreciate any insight or help
Additional notes: