I don't think this mention of endianness is quite right. Endianness usually deals with the binary representation of the integer in memory, but here we're just parsing a sequence of bytes, interpreted as characters, into an integer. There is no inherent endianness going on here.