So I byte shift a integer into 4 bytes of data.
img[4] = (imagewidth >> 24) & 0xFF;
img[5] = (imagewidth >> 16) & 0xFF;
img[6] = (imagewidth >> 8) & 0xFF;
img[7] = imagewidth & 0xFF;
img[8] = (imageheight >> 24) & 0xFF;
img[9] = (imageheight >> 16) & 0xFF;
img[10] = (imageheight >> 8) & 0xFF;
img[11] = imageheight & 0xFF;
Now how would I go about shifting it back to an integer. so img[8]
- img[11]
back to a single int
or img[4]
- img[7]
back to a single int