mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
27 lines
608 B
C#
27 lines
608 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
|
|
namespace BepInEx.Patcher
|
|
{
|
|
internal static class EmbeddedResource
|
|
{
|
|
public static byte[] Get(string resourceName)
|
|
{
|
|
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
|
|
{
|
|
int length = (int)stream.Length;
|
|
|
|
byte[] buffer = new byte[length];
|
|
|
|
stream.Read(buffer, 0, length);
|
|
|
|
return buffer;
|
|
}
|
|
}
|
|
}
|
|
}
|