I am in the process of migrating from BinaryFormatter to Protobuf-net (which so far appears to offer HUGE improvements both in terms of storage size and deserialization time).
A problem I've encountered however is that double?[] arrays do not deserialize in the same form they were serialized. Any values in the array that are null get removed in their entirety - i.e. if I start with an array with 6 elements of [null, null, 1, 2, 3, null], after deserialization I end up with an array of [1, 2, 3]. For my programme, it is essential that I retreive these arrays in exactly the same form they were prior to serialization - as would happen if BinaryFormatter were used.
One solution I have come up with so far is to create two arrays for every one, one of double[] where every element has a value, and one of bool[] which can be used to describe if the original value was null - however this is very inefficient for various reasons.
I could see mentioned in a previous related question that there may be a 'SupportNull' option for a ProtoMember, but I couldn't find any documentation showing clearly how to implement this, and could not work it out myself by playing around.
Any help anyone could offer would be hugely appreciated.