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

ReadContentAsBase64() public method

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

            // init ReadChunkHelper if called the 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 = _readBinaryHelper.ReadContentAsBase64(buffer, index, count);

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

Usage Example

Esempio n. 1
0
 public override int ReadContentAsBase64(byte[] buffer, int index, int count)
 {
     return(_impl.ReadContentAsBase64(buffer, index, count));
 }