mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Patching and extraction works, fewer failing tests
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Wabbajack.Common;
|
||||
|
||||
namespace Wabbajack.VirtualFileSystem
|
||||
{
|
||||
|
||||
public class UnmanagedStreamFactory : IStreamFactory
|
||||
{
|
||||
private readonly unsafe byte* _data;
|
||||
private readonly long _size;
|
||||
|
||||
public unsafe UnmanagedStreamFactory(byte* data, long size)
|
||||
{
|
||||
_data = data;
|
||||
_size = size;
|
||||
}
|
||||
public async ValueTask<Stream> GetStream()
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
return new UnmanagedMemoryStream(_data, _size);
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime LastModifiedUtc => DateTime.UtcNow;
|
||||
public IPath Name => (RelativePath)"Unmanaged Memory Stream";
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user