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

SaveToFile() public method

Save the binary to the given file
public SaveToFile ( String filename ) : bool
filename String the name of the file to save
return bool
        public bool SaveToFile(String filename)
        {
            lock(m_baseBinaryLock)
            {
                try
                {

                    using (BinaryWriter writer = new BinaryWriter(File.Open(filename, FileMode.Create)))
                    {
                        writer.Write(m_stream.ToArray());
                        writer.Flush();
                    }
                    return true;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message + " >" + ex.StackTrace);
                    return false;
                }
            }
        }