Say I have an array of bytes:
byte[] input = { 0xFF, 0xFc, 0x00, 0x00 }
You can use Buffer.BlockCopyto copy bytes from one array to another, regardless of type. So, I can do this:
uint[] output = new uint[1];
Buffer.BlockCopy(input , 0, output, 0, input.Length);
This will copy the bytes from input to output, converting them from the byte array to the uints array along the way.
The problem is that it BlockCopyinterprets bytes with little precision. I need a copy using a large continent. Therefore, instead of getting the value uint 4294705152 (0xFFFC0000), like me, I get the value 64767 (0x0000FCFF). Please note that this is an example with blue bones, I cannot easily change the byte order in my actual application.
Is there anything with convenience and speed BlockCopy, which includes the ability to establish the entity I need?
source
share