HttpServer.Modules.FileModule.SendFile C# (CSharp) Method

SendFile() private method

Will send a file to client.
private SendFile ( IHttpContext context, IResponse response, Stream stream ) : void
context IHttpContext HTTP context containing outbound stream.
response IResponse Response containing headers.
stream Stream File stream
return void
        private void SendFile(IHttpContext context, IResponse response, Stream stream)
        {
            response.ContentLength.Value = stream.Length;

            var generator = HttpFactory.Current.Get<ResponseWriter>();
            generator.SendHeaders(context, response);
            generator.SendBody(context, stream);
        }