1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 17:28:00 +02:00

Allow passing in memory list

This commit is contained in:
Brian Fiete 2021-10-04 09:41:48 -07:00
parent 9879f64b4a
commit 7e75a24807

View file

@ -4,7 +4,7 @@ namespace System.IO
{ {
class MemoryStream : Stream class MemoryStream : Stream
{ {
List<uint8> mMemory = new List<uint8>() ~ delete _; List<uint8> mMemory ~ delete _;
int mPosition = 0; int mPosition = 0;
public override int64 Position public override int64 Position
@ -44,6 +44,16 @@ namespace System.IO
} }
} }
public this()
{
mMemory = new List<uint8>();
}
public this(List<uint8> memory)
{
mMemory = memory;
}
public override Result<int> TryRead(Span<uint8> data) public override Result<int> TryRead(Span<uint8> data)
{ {
let count = data.Length; let count = data.Length;