How can I combine 4 bytes into a 32 bit unsigned integer?

Viewed 21415

I'm trying to convert 4 bytes into a 32 bit unsigned integer.

I thought maybe something like:

UInt32 combined = (UInt32)((map[i] << 32) | (map[i+1] << 24) | (map[i+2] << 16) | (map[i+3] << 8));

But this doesn't seem to be working. What am I missing?

3 Answers
Related