mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-11-19 13:17:07 +00:00
22 lines
500 B
C#
22 lines
500 B
C#
using System.Reflection;
|
|
|
|
namespace BepInEx.Patcher
|
|
{
|
|
internal static class EmbeddedResource
|
|
{
|
|
public static byte[] Get(string resourceName)
|
|
{
|
|
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
|
|
{
|
|
var length = (int) stream.Length;
|
|
|
|
var buffer = new byte[length];
|
|
|
|
stream.Read(buffer, 0, length);
|
|
|
|
return buffer;
|
|
}
|
|
}
|
|
}
|
|
}
|