From e1cfb9c8ce94a5c4425bc97b4354becca829a5e4 Mon Sep 17 00:00:00 2001 From: dahall Date: Mon, 11 Jan 2021 11:19:15 -0700 Subject: [PATCH] Added ISafeMemoryHandle.GetBytes method that was already implemented all implemented classes --- Core/InteropServices/SafeMemoryHandle.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/InteropServices/SafeMemoryHandle.cs b/Core/InteropServices/SafeMemoryHandle.cs index 0dae6fed..5a48b80f 100644 --- a/Core/InteropServices/SafeMemoryHandle.cs +++ b/Core/InteropServices/SafeMemoryHandle.cs @@ -84,6 +84,12 @@ namespace Vanara.InteropServices /// An to the internally held memory. IntPtr DangerousGetHandle(); + /// Gets a copy of bytes from the allocated memory block. + /// The start index. + /// The number of bytes to retrieve. + /// A byte array with the copied bytes. + public byte[] GetBytes(int startIndex, int count); + /// /// Extracts an array of structures of containing items. This /// call can cause memory exceptions if the pointer does not have sufficient allocated memory to retrieve all the structures.