Hi all,
I need to perfom simple-looking task in C#: Converting byte array to short array - meaning that if my byte array has 100 cells, my short array will have 50 cells.
If it was C/C++ it was simple, using pointers. However in C# I just can't do it - I've already tried using 'unsafe' block and memory pinning using GCHandle, with no success.
Another thing that bothers me in the solutions I found is that the conversion is done using memory copying, which is not necessary, since all the information is already there!
I'll be grateful for any solution!
Thanks,
Eyal.
I need to perfom simple-looking task in C#: Converting byte array to short array - meaning that if my byte array has 100 cells, my short array will have 50 cells.
If it was C/C++ it was simple, using pointers. However in C# I just can't do it - I've already tried using 'unsafe' block and memory pinning using GCHandle, with no success.
Another thing that bothers me in the solutions I found is that the conversion is done using memory copying, which is not necessary, since all the information is already there!
I'll be grateful for any solution!
Thanks,
Eyal.
Comment