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.