This repository has been archived on 2025-06-05. You can view files and clone it, but cannot push or open issues or pull requests.

23 lines
527 B
C#

using System.Reflection;
namespace RobloxLegacy.Utilities;
public class Resource(string name)
{
private Stream? GetStream()
{
var assembly = Assembly.GetExecutingAssembly();
return assembly.GetManifestResourceStream($"RobloxLegacy.Resources.{name}");
}
public byte[]? GetBytes()
{
using var stream = GetStream();
if (stream == null)
return null;
using var ms = new MemoryStream();
stream.CopyTo(ms);
return ms.ToArray();
}
}