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)); } }
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); } }