Esempio n. 1
0
 public XmlBuffer(int maxBufferSize)
 {
     if (maxBufferSize < 0)
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxBufferSize", maxBufferSize,
                                             SR.ValueMustBeNonNegative));
     int initialBufferSize = Math.Min(512, maxBufferSize);
     _stream = new BufferManagerOutputStream(SR.XmlBufferQuotaExceeded, initialBufferSize, maxBufferSize,
         BufferManager.CreateBufferManager(0, int.MaxValue));
     _sections = new List<Section>(1);
 }
 public XmlBuffer(int maxBufferSize)
 {
     if (maxBufferSize < 0)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxBufferSize", maxBufferSize, System.ServiceModel.SR.GetString("ValueMustBeNonNegative")));
     }
     int initialSize = Math.Min(0x200, maxBufferSize);
     this.stream = new BufferManagerOutputStream("XmlBufferQuotaExceeded", initialSize, maxBufferSize, BufferManager.CreateBufferManager(0L, 0x7fffffff));
     this.sections = new List<Section>(1);
 }
 public void Close()
 {
     int num;
     if (this.bufferState != BufferState.Created)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(this.CreateInvalidStateException());
     }
     this.bufferState = BufferState.Reading;
     this.buffer = this.stream.ToArray(out num);
     this.writer = null;
     this.stream = null;
 }
Esempio n. 4
0
 public void Close()
 {
     if (_bufferState != BufferState.Created)
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateInvalidStateException());
     _bufferState = BufferState.Reading;
     int bufferSize;
     _buffer = _stream.ToArray(out bufferSize);
     _writer = null;
     _stream = null;
 }