Example #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputContext">The input context to read the content from.</param>
        /// <param name="batchBoundary">The boundary string for the batch structure itself.</param>
        /// <param name="batchEncoding">The encoding to use to read from the batch stream.</param>
        internal ODataBatchReaderStream(
            ODataRawInputContext inputContext,
            string batchBoundary,
            Encoding batchEncoding)
        {
            Debug.Assert(inputContext != null, "inputContext != null");
            Debug.Assert(!string.IsNullOrEmpty(batchBoundary), "!string.IsNullOrEmpty(batchBoundary)");

            this.inputContext  = inputContext;
            this.batchBoundary = batchBoundary;
            this.batchEncoding = batchEncoding;

            this.batchBuffer = new ODataBatchReaderStreamBuffer();

            // When we allocate a batch reader stream we will in almost all cases also call ReadLine
            // (to read the headers of the parts); so allocating it here.
            this.lineBuffer = new byte[LineBufferLength];

            this.mediaTypeResolver = ODataMediaTypeResolver.GetMediaTypeResolver(inputContext.Container);
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 internal ODataBatchReaderStream()
 {
     this.BatchBuffer = new ODataBatchReaderStreamBuffer();
 }