public static void guardarArbol(ArbolBPlus arbol) { string serializationFile = Constants.discoIndice; using (Stream stream = File.Open(serializationFile, FileMode.Create)) { var bformatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); bformatter.Serialize(stream, arbol); } }
public static ArbolBPlus cargarArbol() { string serializationFile = Constants.discoIndice; ArbolBPlus result = new ArbolBPlus(); using (Stream stream = File.Open(serializationFile, FileMode.Open)) { var bformatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); result = (ArbolBPlus)bformatter.Deserialize(stream); } return(result); }