public override void Load(string filepath)
{
FileStream stream = new FileStream(filepath, FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(stream);
try
{
string s;
BinIO.string_read(reader, out s);
if (s == "<object>")
{
BinIO.string_read(reader, out s);
if (s != this.Name && s != this.GetType().Name)
throw new Exception("LenetClassifier: incorrect file format");
this.Load(reader);
BinIO.string_read(reader, out s);
if (s != "</object>")
throw new Exception("Expected string: </object>");
}
else
throw new Exception("Expected string: <object>");
}
finally
{
reader.Close();
stream.Close();
}
}