Best effort zerocopy from Protobuf's ByteString to Netty's ByteBuf #13605
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
tisonkun
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm building a service with gRPC and using Netty's
ByteBuf
as a better byte buffer implementation.So far, when I receive messages from the gRPC channel,
bytes
field is converted into Protobuf'sByteString
. My internal service usesByteBuf
so there is a necessary conversion:I implemented it as above, but this seems always to cause a bytes copy. Are there utilities or libraries to help in doing best-effort zerocopy between these two interfaces? Or is there a better way to write a service instance?
FWIW in my situation the returned bytebuf is always readonly.
Beta Was this translation helpful? Give feedback.
All reactions