Canguro.Model.Load.ResponseSpectrum.Load C# (CSharp) Method

Load() private method

private Load ( string file ) : void
file string
return void
        private void Load(string file)
        {
            try
            {
                name = Path.GetFileNameWithoutExtension(file);
                StreamReader reader = File.OpenText(file);
                string line = reader.ReadLine();
                int len = Convert.ToInt32(line);
                function = new float[len, 2];
                char[] separators = "\t ".ToCharArray();
                for (int i = 0; i < len; i++)
                {
                    line = reader.ReadLine();
                    string[] values = line.Split(separators, StringSplitOptions.RemoveEmptyEntries);
                    function[i, 0] = Convert.ToSingle(values[0]);
                    function[i, 1] = Convert.ToSingle(values[1]);
                }
                reader.Close();
            }
            catch (Exception ex)
            {
                throw new Exception("Invalid rsp File", ex);
            }
        }