mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-18 23:48:35 +02:00
35ab3a28fd
banner-35.jpg (height) banner-70.jpg fanart-180.jpg (height) fanart-360.jpg poster-170.jpg (width) poster-340.jpg
23 lines
547 B
C#
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();
|
|
}
|
|
}
|
|
}
|
|
}
|