예제 #1
0
        public static void SerializeObjectRandomForest(string fileName, ListRandomForests objToSerialize)
        {
            FileStream      fstream         = File.Open(fileName, FileMode.Create);
            BinaryFormatter binaryFormatter = new BinaryFormatter();

            binaryFormatter.Serialize(fstream, objToSerialize);
            fstream.Close();
        }
예제 #2
0
        public static ListRandomForests DeserializeObjectRandomForests(string fileName)
        {
            ListRandomForests objToSerialize  = null;
            FileStream        fstream         = File.Open(fileName, FileMode.Open);
            BinaryFormatter   binaryFormatter = new BinaryFormatter();

            objToSerialize = (ListRandomForests)binaryFormatter.Deserialize(fstream);
            fstream.Close();
            return(objToSerialize);
        }