private void AppendValue(string value, int maxBuffer, ref int remaining)
 {
     XmlMtomReader.DecrementBufferQuota(maxBuffer, ref remaining, value.Length * 2);
     if (this.value == null)
     {
         this.value = value;
     }
     else
     {
         this.value = this.value + value;
     }
 }
 static public XmlDictionaryReader CreateMtomReader(byte[] buffer, int offset, int count, Encoding[] encodings, string contentType,
     XmlDictionaryReaderQuotas quotas, int maxBufferSize, OnXmlDictionaryReaderClose onClose)
 {
     XmlMtomReader reader = new XmlMtomReader();
     reader.SetInput(buffer, offset, count, encodings, contentType, quotas, maxBufferSize, onClose);
     return reader;
 }
 static public XmlDictionaryReader CreateMtomReader(Stream stream, Encoding[] encodings, string contentType,
     XmlDictionaryReaderQuotas quotas, int maxBufferSize, OnXmlDictionaryReaderClose onClose)
 {
     XmlMtomReader reader = new XmlMtomReader();
     reader.SetInput(stream, encodings, contentType, quotas, maxBufferSize, onClose);
     return reader;
 }
 public XopIncludeReader(XmlMtomReader.MimePart part, XmlDictionaryReader reader)
 {
     if (part == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("part");
     }
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
     }
     this.part = part;
     this.parentReader = reader;
     this.readState = System.Xml.ReadState.Initial;
     this.nodeType = XmlNodeType.None;
     this.chunkSize = Math.Min(reader.Quotas.MaxBytesPerRead, this.chunkSize);
     this.bytesRemaining = this.chunkSize;
     this.finishedStream = false;
 }