From 7e75a248077e77d9bde58e633fd259634639b3d2 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 4 Oct 2021 09:41:48 -0700 Subject: [PATCH] Allow passing in memory list --- BeefLibs/corlib/src/IO/MemoryStream.bf | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BeefLibs/corlib/src/IO/MemoryStream.bf b/BeefLibs/corlib/src/IO/MemoryStream.bf index 0980bb1c..53dbe501 100644 --- a/BeefLibs/corlib/src/IO/MemoryStream.bf +++ b/BeefLibs/corlib/src/IO/MemoryStream.bf @@ -4,7 +4,7 @@ namespace System.IO { class MemoryStream : Stream { - List mMemory = new List() ~ delete _; + List mMemory ~ delete _; int mPosition = 0; public override int64 Position @@ -44,6 +44,16 @@ namespace System.IO } } + public this() + { + mMemory = new List(); + } + + public this(List memory) + { + mMemory = memory; + } + public override Result TryRead(Span data) { let count = data.Length;