if you want to prvent the copying use mixed mode C++, using unmanaged C++ you can get a void* pointer to the managed buffer, then you can do with it whatever you want...
Mixed mode C++ array manipulation ( access a System::Byte array as an 'unsigned short' array):
virtual int ManipArray(System::Byte btArray __gc[])
{
int i = 0;
BYTE __pin *pbtArray = &btArray[0];
unsigned short *uiArray = (unsigned short*)pbtArray;
for(i; i < btArray->Length/2; i++)
uiArray[i] <<= 1;
return 0;
}
--
Nadav
http://www.ddevel.com
"kevinniu" wrote:
Hi everyone,
In c#, what is the fastest way(include unsafe) to
convert a array of bytes(which really contains the
bytes of a double array) to a arry of double.
thanks
kn