Quote Originally Posted by KONI
Number2 will contain the least significant bits of your input since I masked it with an 0xFF mask. The bitwise AND together with the mask (0xFF) keeps the 8 least significant bits without changing their values and sets the rest to 0.

Code:
int value2 = FileSize >> 8;
The code above only works if FileSize is exactly 16 bits, it won't work if FileSize is 17 bits or above. By masking with an 8 bit mask, you're making sure that the rest of the bits is discarded/set to zero.
I know it will always be exactly 16 bits as i put the data in as 16 bits, thanks a lot for your help, anding a binary number with that mask only checks the first 8 digits and then set the rest to 0?
so if i and the digits 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 0 with 0xFF the output should be 0 1 0 1 1 1 1 0.