Files
Readarr/src/NzbDrone.Common/Extensions/StreamExtensions.cs
T
Qstick f77a2feeef StyleCop (#1058)
* Stylecop Rules and Fixes
2020-01-03 07:49:24 -05:00

23 lines
534 B
C#

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