Let's say I serialize a List<Double>...
Can I then deserialize just a "portion" of the serialized List? If I need to access a
range of Doubles in the List, do I have to deserialize the entire list and then access the items I need?
I know this is a somewhat strange concept, but it's a real-world requirement. At present, I'm serializing each item in the List using Bitconverter.GetBytes, and storing the 8 bytes into an aggregated byte array which I write to a file. That way, I can
later seek into the file, read a range of bytes and then use BitConverter.ToDouble to get the original double values.
But using BitConverter.GetBytes on each item in a list of 1,000,000 doubles (resulting in an 8,000,000 byte array) is fairly sluggish (over 1/2 second on 2GHz Core 2 Duo). I suspect it would be faster to serialize the entire List<Doubles> all-at-once
rather than item at a time. But do I then give up the ability to "index" into the stored serialized Doubes if I serialize the List rather than the
items in the List?
If I have to deserialize the entire List before I can access individual items in that List, then I'll have to stick with how I'm doing it now... or perhaps find a way to speed-up BitConverter.GetBytes (would this perhaps lend itself to using Parallel.For
View Complete Post