System.Xml.XmlTextReaderImpl.ReadChars C# (CSharp) Method

ReadChars() private method

private ReadChars ( char buffer, int index, int count ) : int
buffer char
index int
count int
return int
        internal int ReadChars(char[] buffer, int index, int count)
        {
            Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create.");
            Debug.Assert(_outerReader is XmlTextReader);

            if (_parsingFunction == ParsingFunction.InIncrementalRead)
            {
                if (_incReadDecoder != _readCharsDecoder)
                { // mixing ReadChars with ReadBase64 or ReadBinHex
                    if (_readCharsDecoder == null)
                    {
                        _readCharsDecoder = new IncrementalReadCharsDecoder();
                    }
                    _readCharsDecoder.Reset();
                    _incReadDecoder = _readCharsDecoder;
                }
                return IncrementalRead(buffer, index, count);
            }
            else
            {
                if (_curNode.type != XmlNodeType.Element)
                {
                    return 0;
                }
                if (_curNode.IsEmptyElement)
                {
                    _outerReader.Read();
                    return 0;
                }

                if (_readCharsDecoder == null)
                {
                    _readCharsDecoder = new IncrementalReadCharsDecoder();
                }

                InitIncrementalRead(_readCharsDecoder);
                return IncrementalRead(buffer, index, count);
            }
        }

Usage Example

示例#1
0
 public int ReadChars(char[] buffer, int index, int count)
 {
     return(_impl.ReadChars(buffer, index, count));
 }
XmlTextReaderImpl