Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support unpacking HeapByteBfuferR #861

Open
takaaki7 opened this issue Dec 8, 2024 · 0 comments
Open

Support unpacking HeapByteBfuferR #861

takaaki7 opened this issue Dec 8, 2024 · 0 comments

Comments

@takaaki7
Copy link

takaaki7 commented Dec 8, 2024

Currently MessagePack.newDefaultUnpacker(ByteBuffer buffer) doesn't support HeapByteBuffer

When passing Read Only ByteBuffer, following exception happened. Because HeapByteBfuferR.hashArray() and HeapByteBfuferR.isDirect() returns false.

throw new IllegalArgumentException("Only the array-backed ByteBuffer or DirectBuffer is supported");

https://github.com/msgpack/msgpack-java/blob/main/msgpack-core/src/main/java/org/msgpack/core/buffer/MessageBuffer.java#L400

I want to unpacking HeapByteBufferR without copying bytes. Because I save msgpack data in BigTable, and BigTable library returns ByteString, and it only able to be no-copy converted to HeapByteBufferR with asReadOnlyByteBuffer().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant