The integer is given as a byte array.
Then each byte is shifted left 0/8/16/24 places and these values are summed to get the integer value.
This is an Int32 in hexadecimal format:
0x10203040
It is represented as following byte array (little endian architecture, so bytes are in reverse order):
[0x40, 0x30, 0x20, 0x10]
In order to build the integer back from the array, each element is shifted i.e. following logic is performed:
a = 0x40 = 0x00000040
b = 0x30 << 8 = 0x00003000
c = 0x20 << 16 = 0x00200000
d = 0x10 << 24 = 0x10000000
then these values are OR'ed together:
int result = a | b | c | d;
this gives:
0x00000040 |
0x00003000 |
0x00200000 |
0x10000000 |
------------------
0x10203040
return (((il[position] | (il[position+1] << 8)) | (il[position+2] << 0x10))(not answering the question, someone has already done that, it's just that theposition++stuff is just hard to read and unnecessary)positionargument isref intso the callee likely depends on index being updated. still, I would do it like you and just addpos += 4at the endposition += sizeof(int)would be even more expressive.sizeofoperator.