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);
}
}