public static SeqPointInfo Read(string path) { using (var reader = new BinaryReader(File.Open(path, FileMode.Open))) { var dataByIds = new Dictionary <Tuple <int, int>, MethodData> (); var dataByTokens = new Dictionary <int, MethodData> (); var methodCount = reader.ReadVariableInt(); for (var i = 0; i < methodCount; ++i) { var methodToken = reader.ReadVariableInt(); var methodIndex = reader.ReadVariableInt(); var methodId = new Tuple <int, int> (methodToken, methodIndex); var methodData = MethodData.Read(reader); dataByIds.Add(methodId, methodData); if (!dataByTokens.ContainsKey(methodToken)) { dataByTokens.Add(methodToken, methodData); } } return(new SeqPointInfo { dataByIds = dataByIds, dataByTokens = dataByTokens }); } }