In Java Client I get a
com.google.protobuf.ByteString capn_object_bytes = response.getCapnObject();
from C++ Server, and I want read the Capn
Object from protobuf.ByteString
@Kenton Varda
Use ByteString#asReadOnlyByteBuffer()
to get a ByteBuffer
, which you can then read into Cap'n Proto:
MessageReader message =
org.capnproto.Serialize.read(capn_object_bytes.asReadOnlyByteBuffer());