I'm trying to implement my own serializable dictionary based on the source code from here.
- Obviously the keys, values, and count need to be serialized.
- MSDN says you should never serialize hash codes.
- But I'm having trouble wrapping my head around the usage of the
buckets
array andEntry.next
field to determine if they should be serialized and if not, then how would I go about recalculating them during deserialization? - It's also entirely possible that since the arrangement of entries is derived from their hash codes in the first place, the arrays can't be directly serialized anyway and I should just use a regular dictionary synchronised with separate serialized key and value arrays.
Can anyone shed some light on this?