New: Failed download handling for Nzbget

This commit is contained in:
Mark McDowall
2014-03-20 00:08:15 -07:00
parent b60633882e
commit bac75ac6d9
14 changed files with 189 additions and 40 deletions
@@ -0,0 +1,21 @@
using System.IO;
namespace NzbDrone.Common.Extensions
{
public static class StreamExtensions
{
public static byte[] ToBytes(this Stream input)
{
var buffer = new byte[16 * 1024];
using (var ms = new MemoryStream())
{
int read;
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
{
ms.Write(buffer, 0, read);
}
return ms.ToArray();
}
}
}
}