The code is splitting the 32-bit number
inputFileSize
into 4 bytes stored to
tempByte[]
in reverse order. It is similar to
tempByte[0] = (inputFileSize >> 24) & 0xff;
tempByte[1] = (inputFileSize >> 16) & 0xff;
tempByte[2] = (inputFileSize >> 8) & 0xff;
tempByte[3] = inputFileSize & 0xff;
The loop starts at 24 because that is by how many bits the highest byte must be shifted to get it into the position of an 8-bit value.