How does Protobuf-net support for Dictionary/KeyValuePair works?

前端 未结 2 622
庸人自扰
庸人自扰 2021-01-14 01:17

I am trying to understand protobuf-net\'s Dictionary/KeyValuePair support. We would like to use the underlying binary stream and the generated proto file from java, but the

2条回答
  •  时光取名叫无心
    2021-01-14 01:32

    To get this for work add a new message to the generated .proto file that looks like this.

    message Pair_String_Int32 {
     required string Key = 1;
     required int32 Value = 2;    
    }
    

    Then protoc will be able to create the corresponding code for Java.

提交回复
热议问题