I know you can get the first byte by using
int x = number & ((1<<8)-1);
or
int x = number & 0xFF;
int x = (number >> (8*n)) & 0xff;
where n is 0 for the first byte, 1 for the second byte, etc.