I am trying to implement the Business Transaction Feed on a C# tool. I was able to create the C# class using the protobuf tools provided by google.
I am getting the post request and I am able to get the byteArray containing the data. This is the part where I am stuck: How do I convert the byteArray to an object of the class generated by protobuf.
There are several classes available in the class file, but I am not managing to make it usefull.
Can anybody give me a hint or a tutorial?
Solved! Go to Solution.
Apparently protobuf provides it's own parser.
hereby the code snippet I used.
if (Request.ContentLength > 0)
buffer = new byte[Request.ContentLength];
using (BinaryReader br = new BinaryReader(Request.InputStream))
br.Read(buffer, 0, buffer.Length);
BusinessTransactions bts = BusinessTransactions.Parser.ParseFrom(buffer);