System.Runtime.InteropServices.Marshal.Copy Method

Copies data from an unmanaged memory pointer to a managed 32-bit signed integer array.

Syntax

public static void Copy (IntPtr source, int[] destination, int startIndex, int length)

Parameters

source
The memory pointer to copy from.
destination
The array to copy to.
startIndex
The zero-based index in the destination array where copying should start.
length
The number of array elements to copy.

Remarks

Unmanaged, C-style arrays do not contain bounds information, which prevents the startIndex and length parameters from being validated. Thus, the unmanaged data corresponding to the source parameter populates the managed array regardless of its usefulness. You must initialize the managed array with the appropriate size before calling this method.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0