/* * ByteBuffer */ public static ByteBuffer ConvertFromProtoFormat(ByteString byteString) { int capacity = byteString.AsReadOnlyByteBuffer().Rewind().Remaining(); byte[] b = new byte[capacity]; byteString.AsReadOnlyByteBuffer().Get(b, 0, capacity); return(ByteBuffer.Wrap(b)); }