public static ConcurrentDictionary <int, ConcurrentDictionary <byte, float?> > ReadNullableFloatFieldDictionary(this ITypeReader serializer) { var result = new ConcurrentDictionary <int, ConcurrentDictionary <byte, float?> >(); try { var cnt = serializer.ReadInt(); for (int i = 0; i < cnt; i++) { var key = serializer.ReadInt(); var val = new ConcurrentDictionary <byte, float?>(); var subCnt = serializer.ReadInt(); for (int j = 0; j < subCnt; j++) { var subKey = serializer.ReadByte(); var subValue = serializer.ReadNullableFloat(); val.TryAdd(subKey, subValue); } result.TryAdd(key, val); } } catch (Exception e) { throw new Exception($"Error serializing ConcurrentDictionary<int, ConcurrentDictionary<ChangeFieldIndexes, float?>>: {e}"); } return(result); }