Any time you serialize a data structure containing pointers, you need to convert those pointers into something other than pointers. One possibility is to turn them into offsets within the data stream; another possibility is to remove them altogether and rely on the organization of the stream itself. Either way, you need to write down the serialization format with great precision; the rule of thumb is, someone should be able to write code from scratch that either produces or consumes the serialization without any information other than the specification you write.
Here's one possible way to serialize the data structures you showed:
# Each row is a 32-bit unsigned value in network byte order.
| number of pairs following |
| [0].value1 |
| [0].value2 |
| [1].value1 |
| [2].value2 |
...
| [N].value1 |
| [N].value2 |
Good examples - both of how to do this sort of thing and how to document it - may be found in the TCP and IP RFCs, or the PNG specification.