예제 #1
0
파일: XmlBuffer.cs 프로젝트: mbearup/wcf
        public void CloseSection()
        {
            if (this.bufferState != XmlBuffer.BufferState.Writing)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(this.CreateInvalidStateException());
            }
            this.writer.Close();
            this.bufferState = XmlBuffer.BufferState.Created;
            int size = (int)this.stream.Length - this.offset;

            this.sections.Add(new XmlBuffer.Section(this.offset, size, this.quotas));
            this.offset = this.offset + size;
        }
예제 #2
0
파일: XmlBuffer.cs 프로젝트: mbearup/wcf
        public void Close()
        {
            if (this.bufferState != XmlBuffer.BufferState.Created)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(this.CreateInvalidStateException());
            }
            this.bufferState = XmlBuffer.BufferState.Reading;
            int bufferSize;

            this.buffer = this.stream.ToArray(out bufferSize);
            this.writer = (XmlDictionaryWriter)null;
            this.stream = (BufferedOutputStream)null;
        }
예제 #3
0
파일: XmlBuffer.cs 프로젝트: mbearup/wcf
 public XmlDictionaryWriter OpenSection(XmlDictionaryReaderQuotas quotas)
 {
     if (this.bufferState != XmlBuffer.BufferState.Created)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(this.CreateInvalidStateException());
     }
     this.bufferState = XmlBuffer.BufferState.Writing;
     this.quotas      = new XmlDictionaryReaderQuotas();
     quotas.CopyTo(this.quotas);
     if (this.writer == null)
     {
         this.writer = XmlDictionaryWriter.CreateBinaryWriter((Stream)this.stream, (IXmlDictionary)XD.Dictionary, (XmlBinaryWriterSession)null, true);
     }
     else
     {
         ((IXmlBinaryWriterInitializer)this.writer).SetOutput((Stream)this.stream, (IXmlDictionary)XD.Dictionary, (XmlBinaryWriterSession)null, true);
     }
     return(this.writer);
 }