EpLibrary.cs.BinaryFile.LoadFromFile C# (CSharp) Method

LoadFromFile() public method

Load the list of the properties from the given file
public LoadFromFile ( String filename ) : bool
filename String the name of the file to load
return bool
        public bool LoadFromFile(String filename)
        {
            lock(m_baseBinaryLock)
            {
                try
                {
                    using (BinaryReader reader = new BinaryReader(File.Open(filename, FileMode.Open)))
                    {
                        FileInfo fInfo = new FileInfo(filename);
                        m_stream.SetLength(fInfo.Length);
                        reader.Read(m_stream.GetBuffer(), 0, (int)fInfo.Length);
                        m_stream.Seek(0, SeekOrigin.Begin);
                    }
                    return true;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message + " >" + ex.StackTrace);
                    return false;
                }
            }
        }