Пример #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                try
                {
                    if (this.AvroWriter != null)
                    {
                        this.AvroWriter.Flush();
                        this.AvroWriter.Dispose();
                    }

                    if (this.outputStream != null)
                    {
                        this.outputStream.Flush();
                        this.outputStream.Dispose();
                    }
                }
                finally
                {
                    this.AvroWriter   = null;
                    this.outputStream = null;
                }
            }

            base.Dispose(disposing);
        }
Пример #2
0
 internal ODataAvroOutputContext(
     ODataFormat format,
     ODataMessageInfo messageInfo,
     ODataMessageWriterSettings messageWriterSettings)
     : base(format, messageInfo, messageWriterSettings)
 {
     this.outputStream = messageInfo.MessageStream;
     this.AvroWriter   = new AvroWriter(new StreamWrapper(outputStream));
 }
Пример #3
0
 internal ODataAvroOutputContext(
      ODataFormat format,
      Stream messageStream,
      Encoding encoding,
      ODataMessageWriterSettings messageWriterSettings,
      bool writingResponse,
      bool synchronous,
      IEdmModel model,
      IODataUrlResolver urlResolver)
     : base(format, messageWriterSettings, writingResponse, synchronous, model, urlResolver)
 {
     this.outputStream = messageStream;
     this.AvroWriter = new AvroWriter(new StreamWrapper(outputStream));
 }
Пример #4
0
 internal ODataAvroOutputContext(
     ODataFormat format,
     Stream messageStream,
     Encoding encoding,
     ODataMessageWriterSettings messageWriterSettings,
     bool writingResponse,
     bool synchronous,
     IEdmModel model,
     IODataUrlResolver urlResolver)
     : base(format, messageWriterSettings, writingResponse, synchronous, model, urlResolver)
 {
     this.outputStream = messageStream;
     this.AvroWriter   = new AvroWriter(new StreamWrapper(outputStream));
 }
Пример #5
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                try
                {
                    if (this.AvroWriter != null)
                    {
                        this.AvroWriter.Flush();
                        this.AvroWriter.Dispose();
                    }

                    if (this.outputStream != null)
                    {
                        this.outputStream.Flush();
                        this.outputStream.Dispose();
                    }

                }
                finally
                {
                    this.AvroWriter = null;
                    this.outputStream = null;
                }
            }

            base.Dispose(disposing);
        }