I need to serialise a number of objects to file, so was looking to give ProtoBuf-Net a try. One requirement is that I need to be able to deserialise the objects one at a time at a later date, so my first thought was to use Serializer.SerializeWithLengthPrefix
& Serializer.DeserializeWithLengthPrefix
.
I then saw this SO answer which seemed to suggest that it may be possible to add the objects to a list then serialise this with a single call, but still be able to deserialise the individual objects one at a time afterwards. However I can't see the methods mentioned (SerializeItems
&& DeserializeItems
), although it was an old article so I'm guessing these have been deprecated?
Am I best sticking with De/SerializeWithLengthPrefix, or is there a more efficient way to serialise a few thousand objects in one go, yet still be able to deserialise them one by one afterwards?