Dictionary<int, Dictionary<double, List<double>>> Table; //For brevity I have left out the code for loading data into Table. //However, I have confirmed that the data is being correctly loaded into Table. #region serialize data System.Data.Linq.Binary serializedData; using (var ms1 = new MemoryStream()) { var bf = new BinaryFormatter(); bf.Serialize(ms1, Table); using (var ms2 = new MemoryStream()) { using (var gz = new GZipStream(ms2, CompressionMode.Compress)) { var data = ms1.GetBuffer(); gz.Write(data, 0, data.Length); serializedData = ms2.GetBuffer(); } } } #endregion serialize data #region deserialize data Dictionary<int, Dictionary<double, List<double>>> table; using (var ms = new MemoryStream(serializedData.ToArray())) { using (var gz = new GZipStream(ms, CompressionMode.Decompress)) { var bf = new BinaryFormatter(); table = (Dictionary<int, Dictionary<double, List<double>>>)bf.Deserialize(gz); } } #endregion deserialize data
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)