c#使用protobuf

.proto Type Notes C++ Type Java Type Python Type[2] Go Type C# Type
double double double float float64 double
float float float float float32 float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long[3] int64 long
uint32 Uses variable-length encoding. uint32 int[1] int/long[3] uint32 uint
uint64 Uses variable-length encoding. uint64 long[1] int/long[3] uint64 ulong
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long[3] int64 long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 228. uint32 int[1] int/long[3] uint32 uint
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 256. uint64 long[1] int/long[3] uint64 ulong
sfixed32 Always four bytes. int32 int int int32 int
sfixed64 Always eight bytes. int64 long int/long[3] int64 long
bool bool boolean bool bool bool
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode[4] string string
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString

安装

参考这个https://blog.csdn.net/pigautumn/article/details/89386457

先去了解了nuget,可以直接右键项目进行管理

image-20200628172918493

image-20200628173010951

如何区分protobuf类别

© 2021 hanbaoaaa record.浙ICP备20005263号
asdad
联系方式 asdasd
2021-5-8 4:19
sss
回复数 (0) 点击展开
加载更多

新增评论

称呼
联系方式
邮箱(选填)
内容

提交

取消