aboutsummaryrefslogtreecommitdiff
path: root/lib/Utils/src/IO
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-11-02 21:32:44 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-11-02 21:32:44 -0400
commit59599b0f3e57d1881639d482bf1758c7f93d0dc2 (patch)
treeda14ad0c450542e37e2f597db22337343c68e2dc /lib/Utils/src/IO
parent9e3dd9be0f0ec7aaef1a719f09f96425e66369df (diff)
Unify memory api and add more tests
Diffstat (limited to 'lib/Utils/src/IO')
-rw-r--r--lib/Utils/src/IO/VnMemoryStream.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Utils/src/IO/VnMemoryStream.cs b/lib/Utils/src/IO/VnMemoryStream.cs
index 7ac56a6..45c4a55 100644
--- a/lib/Utils/src/IO/VnMemoryStream.cs
+++ b/lib/Utils/src/IO/VnMemoryStream.cs
@@ -368,7 +368,7 @@ namespace VNLib.Utils.IO
}
//get the value at the current position
- ref byte ptr = ref _buffer.GetByteOffsetRef((nuint)_position);
+ ref byte ptr = ref _buffer.GetOffsetByteRef((nuint)_position);
//Increment position
_position++;
@@ -488,7 +488,7 @@ namespace VNLib.Utils.IO
_length = newPos;
}
//Copy the input buffer to the internal buffer
- MemoryUtil.Copy(buffer, _buffer, (nuint)_position);
+ MemoryUtil.Copy(buffer, 0, _buffer, (nuint)_position, buffer.Length);
//Update the position
_position = newPos;
}
@@ -527,7 +527,7 @@ namespace VNLib.Utils.IO
byte[] data = new byte[_length];
//Copy the internal buffer to the new array
- MemoryUtil.Copy(_buffer, 0, data, 0, (nuint)_length);
+ MemoryUtil.CopyArray(_buffer, 0, data, 0, (nuint)_length);
return data;
}