SbNativeArrayTDataPointer Property |
Namespace: OIV.Inventor.Generic
Exception | Condition |
---|---|
ObjectDisposedException | Stream is closed. |
The returned pointer can be used in an unsafe code block to iterate thought the elements.
The property will return a valid result even if the stream has been build with a managed array as input parameter. The following code should initialize the stream build over a managed array.
float[] floatArray = new float[100]; SbNativeArray<float> floatBuffer = new SbNativeArray<float>(floatArray, true); unsafe { float* floatPtr = (float*) floatBuffer.DataPointer; for (int i = 0; i < floatArray.Length; i++ ) { *floatPtr++ = 10.2f; } }
As read/write operation may occur in an unsafe block, no check will be performed to know if the buffer supports read/write access.