public Stream Recieve(HttpContextBase httpContext, ILittleConvoyConfiguration configuration)
        {
            var data = httpContext.Request["_json"];

            if (string.IsNullOrWhiteSpace(data))
                return new MemoryStream();

            var bytes = Encoding.UTF8.GetBytes(data);
            return new MemoryStream(bytes);
        }
        public void Send(Stream sourceStream, HttpContextBase httpContext, ILittleConvoyConfiguration configuration)
        {
            //httpContext.Response.AddHeader("P3P", "CP=\"ALL DSP CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT\""); // make ie happy
            httpContext.Response.BufferOutput = false;
            httpContext.Response.ContentType = "text/html";

            int callId;

            if (!int.TryParse(httpContext.Request["_callId"], out callId))
                ShowError(httpContext, "Numeric _callId must be part of request");

            int delay;
            var delayString = httpContext.Request["_delay"];
            int.TryParse(delayString, out delay);

            sourceStream.Position = 0;

            using (var readStream = sourceStream)
            using (var streamReader = new StreamReader(readStream))
            using (var writer = new StreamWriter(httpContext.Response.OutputStream))
            using (var htmlWriter = new ChunkedJavascriptHtmlWriter(writer))
                htmlWriter.WriteChunks(callId, streamReader.ReadToEnd(), configuration.NumberOfChunks, configuration.StartPercent, delay);
        }
 public ModelBinderProvider(ITransport transport, ILittleConvoyConfiguration configuration)
 {
     this.transport = transport;
     this.configuration = configuration;
 }
 public bool ShouldProcess(HttpContextBase httpContext, ILittleConvoyConfiguration configuration)
 {
     return !string.IsNullOrWhiteSpace(httpContext.Request["_callid"]);
 }