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

ReadElementContentAsBinHex() public method

public ReadElementContentAsBinHex ( byte buffer, int index, int count ) : int
buffer byte
index int
count int
return int
        public override int ReadElementContentAsBinHex(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 = _readBinaryHelper.ReadElementContentAsBinHex(buffer, index, count);

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

Usage Example

示例#1
0
 public override int ReadElementContentAsBinHex(byte[] buffer, int index, int count)
 {
     return(_impl.ReadElementContentAsBinHex(buffer, index, count));
 }