public void Deserialize(System.IO.Stream s) { int itemCount = s.ReadInt32().Swap(); for (int i = 0; i < itemCount; i++) { IHydraItem item = HydraItemDeserializer.Deserialize(s); Items.Add(item); } }
public void Deserialize(System.IO.Stream s) { int itemCount = s.ReadInt32().Swap(); for (int i = 0; i < itemCount; i++) { IHydraItem key = HydraItemDeserializer.Deserialize(s); if (!(key is HydraUtf8String)) { throw new NotImplementedException(); } HydraUtf8String stringKey = key as HydraUtf8String; IHydraItem value = HydraItemDeserializer.Deserialize(s); Items.Add(stringKey.Value, value); } }