byte[] sourceData = GetImmutableData(); Rhino.ConstPointersourcePtr = new Rhino.ConstPointer (sourceData); SomeFunctionThatRequiresAPointer(sourcePtr, sourceData.Length);
IntPtr unmanagedPtr = GetUnmanagedPointer(); Rhino.ConstPointerIn this code, we have a pointer to unmanaged memory (unmanagedPtr) that we want to read data from. We create a ConstPointer object that wraps the raw pointer and specifies the size of the data to read, and then pass the pointer to a function that will read the data. The Rhino.ConstPointer class is part of the RhinoCommon library, which is included with the Rhino 3D modeling software. It is available as a NuGet package for use in other C# projects.dataPtr = new Rhino.ConstPointer (unmanagedPtr, dataSize); DoSomethingWithData(dataPtr);