Monobjc.Tools.Generator.Parsers.Sgml.HtmlStream.DecodeBlock C# (CSharp) Method

DecodeBlock() private method

private DecodeBlock ( ) : void
return void
        internal void DecodeBlock()
        {
            // shift current chars to beginning.
            if (this.pos > 0)
            {
                if (this.pos < this.used)
                {
                    Array.Copy(this.m_buffer, this.pos, this.m_buffer, 0, this.used - this.pos);
                }
                this.used -= this.pos;
                this.pos = 0;
            }
            int len = this.m_decoder.GetCharCount(this.rawBuffer, this.rawPos, this.rawUsed - this.rawPos);
            int available = this.m_buffer.Length - this.used;
            if (available < len)
            {
                char[] newbuf = new char[this.m_buffer.Length + len];
                Array.Copy(this.m_buffer, this.pos, newbuf, 0, this.used - this.pos);
                this.m_buffer = newbuf;
            }
            this.used = this.pos + this.m_decoder.GetChars(this.rawBuffer, this.rawPos, this.rawUsed - this.rawPos, this.m_buffer, this.pos);
            this.rawPos = this.rawUsed; // consumed the whole buffer!
        }