c# - How do I convert byte array to UInt32 array? -


Let's say that I got the code in C ++ like this ..

  Zero * target uint32 * DecPacket = (uint32 *) target;   

Then it will happen in C #.

  byte [] target; UInt32 [] DeCaapet = (UInt32 []) target;   

type byte [] UIT can not be converted to []

I will align this memory to C ++ How to change in the array for #?

OK, something must be used:

  uint [ ] Decoded = new UIT [target. Length / 4]; Buffer BlockCopy (goal, 0, decode, 0, goal. Length);   

Note that the number of bytes to always copy the last logic of blockcopy , regardless of the type of copy you are copying Regardless of

You can not only consider the byte ARM in a code as uint Sir # (at least not in secure code; I do not know Is in the unsafe code) - but the buffer. Blackcopy will divide the byte array into uint array ... based on the system's end-of-end status, personally I am a fan of this approach No leaves this code, but there are chances of errors when you go to the system with a different memory layout I prefer to be clear in my protocol. Hope you will help you in this matter

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -