Moved Extension methods in common to subfolder

This commit is contained in:
Mark McDowall
2014-12-01 22:26:25 -08:00
parent d01c706082
commit 6467167046
149 changed files with 150 additions and 21 deletions
@@ -0,0 +1,24 @@
using System;
using System.IO;
using System.Reflection;
namespace NzbDrone.Common.Extensions
{
public static class ResourceExtensions
{
public static Byte[] GetManifestResourceBytes(this Assembly assembly, String name)
{
var stream = assembly.GetManifestResourceStream(name);
var result = new Byte[stream.Length];
var read = stream.Read(result, 0, result.Length);
if (read != result.Length)
{
throw new EndOfStreamException("Reached end of stream before reading enough bytes.");
}
return result;
}
}
}