I would like to work with Any in a Message declaration:

message RangeData { 
int32 rows = 1;
int32 columns = 2;
google.protobuf.Any data = 3;
}

In the application, RangeData.data contains two-dimensional tabular data - 
floats, ints, string.

I can get my data into a byte[] array, but I'm not clear what is the API to 
populate RangeData:

var rd = new RangeData
{
   Rows = 100,
   Columns = 100,
   Data = ?
}

Do I use MergeFrom(this IMessage source, byte[] data) extension method? It 
looks like at minimum I would need to do this:

var rd = new RangeData
{
   Rows = 100,
   Columns = 100,
   Data = new Google.Protobuf.WellKnownTypes.Any(); 
};

rd.Data.MergeFrom(myByteArray);

But I'm getting an exception:

InvalidProtocolBufferException - Protocol message contained an invalid 
tag(zero).

~~~

Thanks for your help
Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to