mapdb
mapdb copied to clipboard
Simplest way to get value as byte buffer with only 1 memory copy operation
I've noticed even using regular value serializer SerializerArray would cause multiple copies of underlying raw bytes. Ideally I'd like to get only 1 copy for thread safety.
What's the simplest way to get byte[]/ByteBuffer
for key with minimum number (1) memory copy operations from DirectStore
?
I've done some code checks and looks like it's doable by creating custom deserializer.
Is it safe to assume, what DataInput2.internalByteBuffer
will have copy already ready if it's retrieved from DirectStore
or there are more copies of memory one should be aware of?
Thanks!