Antlr4.Runtime.AntlrFileStream.Load C# (CSharp) Method

Load() public method

public Load ( string fileName, System.Text.Encoding encoding ) : void
fileName string
encoding System.Text.Encoding
return void
        public virtual void Load(string fileName, Encoding encoding)
        {
            if (fileName == null)
            {
                return;
            }

            string text;
            #if !COMPACT
            if (encoding != null)
                text = File.ReadAllText(fileName, encoding);
            else
                text = File.ReadAllText(fileName);
            #else
            if (encoding != null)
                text = ReadAllText(fileName, encoding);
            else
                text = ReadAllText(fileName);
            #endif

            data = text.ToCharArray();
            n = data.Length;
        }