1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-18 23:48:35 +02:00
Sonarr/src/NzbDrone.Common/Extensions/StreamExtensions.cs
Taloth Saldono 35ab3a28fd New: MediaCover api now includes several resized variants to save bandwidth for mobile apps.
banner-35.jpg (height)
banner-70.jpg
fanart-180.jpg (height)
fanart-360.jpg
poster-170.jpg (width)
poster-340.jpg
2015-01-29 19:27:09 +01:00

23 lines
547 B
C#

using System;
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();
}
}
}
}