System.Runtime.InteropServices.SafeBuffer.Initialize Method

Specifies the allocation size of the memory buffer by using the specified number of elements and element size. You must call this method before you use the System.Runtime.InteropServices.SafeBuffer instance.

Syntax

[System.CLSCompliant(false)]
public void Initialize (uint numElements, uint sizeOfEachElement)

Parameters

numElements
The number of elements in the buffer.
sizeOfEachElement
The size of each element in the buffer.

Remarks

This method defines the required size of the memory region as the number of elements in an array multiplied by the size of each element.

Requirements

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