The file size in the image is little endian (https://en.wikipedia.org/wiki/Endianness). This code stores the integer as little endian irregardless of the
machines actual endianness (https://en.wikipedia.org/wiki/Endianness).

The code assumes that a character has 8 bits. The first line extracts the first byte of the integer, the
second line the next higher byte (shifting it to the right by 8 bits and cutting the rest off), the third line
the next higher bytes (shifting it right by 16, cutting the rest of) and the last line extracts the highest
byte.