To explain: I have array of ints as input. I need to convert it to array of bytes, where 1 int = 4 bytes (big endian). In C++, I can easily just cast it and then access to the field as if it was byte array, without copying or counting the data – just direct access. Is this possible in C#? And in C# 2.0?
Share
Yes, using unsafe code:
If the compiler complains, add a
(void*):