System.Xml.XmlBinaryReader.SetInput C# (CSharp) Method

SetInput() public method

public SetInput ( byte buffer, int offset, int count, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quotas, XmlBinaryReaderSession session, OnXmlDictionaryReaderClose onClose ) : void
buffer byte
offset int
count int
dictionary IXmlDictionary
quotas XmlDictionaryReaderQuotas
session XmlBinaryReaderSession
onClose OnXmlDictionaryReaderClose
return void
        public void SetInput(byte[] buffer, int offset, int count,
                            IXmlDictionary dictionary,
                            XmlDictionaryReaderQuotas quotas,
                            XmlBinaryReaderSession session,
                            OnXmlDictionaryReaderClose onClose)
        {
            if (buffer == null)
                throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(buffer));
            if (offset < 0)
                throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.ValueMustBeNonNegative)));
            if (offset > buffer.Length)
                throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)));
            if (count < 0)
                throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.ValueMustBeNonNegative)));
            if (count > buffer.Length - offset)
                throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));
            MoveToInitial(quotas, session, null);
            BufferReader.SetBuffer(buffer, offset, count, dictionary, session);
            _buffered = true;
        }

Same methods

XmlBinaryReader::SetInput ( Stream stream, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quotas, XmlBinaryReaderSession session, OnXmlDictionaryReaderClose onClose ) : void

Usage Example

 public static XmlDictionaryReader CreateBinaryReader(byte[] buffer, int offset, int count,
                                                      IXmlDictionary dictionary,
                                                      XmlDictionaryReaderQuotas quotas,
                                                      XmlBinaryReaderSession session,
                                                      OnXmlDictionaryReaderClose onClose)
 {
     XmlBinaryReader reader = new XmlBinaryReader();
     reader.SetInput(buffer, offset, count, dictionary, quotas, session, onClose);
     return reader;
 }
All Usage Examples Of System.Xml.XmlBinaryReader::SetInput