using System; using p = Google.Protobuf; namespace TestProtobuf { class MainClass { public static void Main(string[] args) { var c = new Person { FirstName = "Anders", LastName = "Hejlsberg" }; int n = c.CalculateSize(); var ba = new byte[n]; var os = new p.CodedOutputStream(ba); c.WriteTo(os); var s = Convert.ToBase64String(ba); Console.WriteLine(s); } } }
"Simplicity can't be bought later, it must be earned from the start" -- DB
Friday, December 9, 2016
Convert protobuf to base64
Subscribe to:
Post Comments (Atom)
This is very interesting, You are a very skilled blogger.
ReplyDeleteI have joined your feed and look forward to seeking more of your fantastic
post. Also, I have shared your website in my
social networks!