Van*_*s S 1 c# protocol-buffers
我将我的protobuf消息保存到文件,格式全部搞砸了.我已经看到它在protobug消息以与.proto文件几乎相同的格式保存到磁盘之前完成.我这样做:
using (Stream output = File.OpenWrite(@"logs\listings.txt"))
{
listingBook.AddClisting(_listing);
listingBook.Build().WriteTo(output);
}
Run Code Online (Sandbox Code Playgroud)
但我得到的是一个错误的文件,似乎ENTER与奇怪的标签分开.将它保存到磁盘时我想要的样子就像示例:
# Textual representation of a protocol buffer.
# This is *not* the binary format used on the wire.
person {
name: "John Doe"
email: "jdoe@example.com"
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
274 次 |
| 最近记录: |