RtfDomParser.RTFReader.ReadToEndGround C# (CSharp) Method

ReadToEndGround() public method

read and ignore data , until just the end of current group,preserve the end.
public ReadToEndGround ( ) : void
return void
        public void ReadToEndGround( )
        {
            int level = 0;
            while (true)
            {
                int c = myReader.Peek();
                if (c == -1)
                {
                    break;
                }
                else if (c == '{')
                {
                    level++;
                }
                else if (c == '}')
                {
                    level--;
                    if (level < 0)
                    {
                        break;
                    }
                }
                c = myReader.Read();
            }
        }