mirror of
https://github.com/AssetRipper/Fmod5Sharp.git
synced 2026-11-13 18:07:13 -10:00
17 lines
548 B
C#
17 lines
548 B
C#
using System;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
|
|
namespace Fmod5Sharp.Tests
|
|
{
|
|
public static class Extensions
|
|
{
|
|
public static byte[] LoadResource(this object _, string filename)
|
|
{
|
|
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream($"Fmod5Sharp.Tests.TestResources.{filename}") ?? throw new Exception($"File {filename} not found.");
|
|
using BinaryReader reader = new BinaryReader(stream);
|
|
|
|
return reader.ReadBytes((int)stream.Length);
|
|
}
|
|
}
|
|
} |