Created
July 3, 2012 10:44
-
-
Save hazzik/3038986 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DelegatedFileStreamResult : FileResult | |
{ | |
readonly Action<Stream> _writer; | |
public DelegatedFileStreamResult(Action<Stream> writer, string contentType) | |
: base(contentType) | |
{ | |
_writer = writer; | |
} | |
protected override void WriteFile(HttpResponseBase response) | |
{ | |
_writer(response.OutputStream); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.IO;
namespace System.Web.Mvc
{
public class FileStreamResult : FileResult
{
// default buffer size as defined in BufferedStream type
private const int BufferSize = 0x1000;
}