ClearCanvas.ImageServer.Services.Streaming.ImageStreaming.WADORequestProcessor.SendWADOResponse C# (CSharp) Method

SendWADOResponse() private static method

Generates a http response based on the specified response object and send it to the client
private static SendWADOResponse ( ClearCanvas.ImageServer.Services.Streaming.ImageStreaming.WADOResponse response, HttpListenerContext context ) : void
response ClearCanvas.ImageServer.Services.Streaming.ImageStreaming.WADOResponse
context System.Net.HttpListenerContext
return void
        private static void SendWADOResponse(WADOResponse response, HttpListenerContext context)
        {
                
            context.Response.StatusCode = (int) HttpStatusCode.OK; // TODO: what does http protocol say about how error that occurs after OK status has been sent should  be handled?

            context.Response.ContentType = response.ContentType;

            if (response.Output == null)
            {
                context.Response.ContentLength64 = 0;

            }
            else
            {
                context.Response.ContentLength64 = response.Output.Length;
                Stream output = context.Response.OutputStream;
                output.Write(response.Output, 0, response.Output.Length);
            }

        }