Exemple #1
0
        public static T Deserialize <T>(string path, SerializeBinders binders)
        {
            CompactSerializer cs = new CompactSerializer(binders);

            using (StreamReader sr = new StreamReader(path, encoding))
            {
                return(cs.Deserialize <T>(sr));
            }
        }
Exemple #2
0
        public static void Serialize(object data, string path, SerializeBinders binders)
        {
            CompactSerializer cs = new CompactSerializer(binders);

            using (StreamWriter sw = new StreamWriter(path))
            {
                cs.Serialize(data, sw);
            }
        }