Radarr/src/Radarr.Http/ByteArrayResponse.cs
2020-12-24 12:21:17 -05:00

21 lines
441 B
C#

using System.IO;
using Nancy;
namespace Radarr.Http
{
public class ByteArrayResponse : Response
{
public ByteArrayResponse(byte[] body, string contentType)
{
ContentType = contentType;
Contents = stream =>
{
using (var writer = new BinaryWriter(stream))
{
writer.Write(body);
}
};
}
}
}