How can I represent a two-dimensional array in protocol buffers?

How can I represent a two-dimensional array in protocol buffers?

I need to store int and double 2d arrays as a field in a PB message, for example:

 int[][] multi = new int[5][10]; 

I use C ++, Java and C #.

Thanks in advance.

+8
java multidimensional-array protocol-buffers
source share
1 answer

There is no direct support in this protocol. It is best to have a repeated set of objects, each of which has an array - i.e.

 message Foo { repeated int items = 1; } ... repeated Foo foos = 1; 
+5
source share

All Articles