System.Xml.XmlValidatingReaderImpl.ReadContentAsBinHexAsync C# (CSharp) Method

ReadContentAsBinHexAsync() public method

public ReadContentAsBinHexAsync ( byte buffer, int index, int count ) : Task
buffer byte
index int
count int
return Task
        public override async Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
        {
            if (ReadState != ReadState.Interactive)
            {
                return 0;
            }

            // init ReadChunkHelper when called first time
            if (_parsingFunction != ParsingFunction.InReadBinaryContent)
            {
                _readBinaryHelper = ReadContentAsBinaryHelper.CreateOrReset(_readBinaryHelper, _outerReader);
            }

            // set parsingFunction to Read state in order to have a normal Read() behavior when called from readBinaryHelper
            _parsingFunction = ParsingFunction.Read;

            // call to the helper
            int readCount = await _readBinaryHelper.ReadContentAsBinHexAsync(buffer, index, count).ConfigureAwait(false);

            // setup parsingFunction 
            _parsingFunction = ParsingFunction.InReadBinaryContent;
            return readCount;
        }