Probably easier when just looking at the bytes vs bit level:
Taking your first post sample of the 2097217:
Hex (32 bit) this would be 00 20 00 41, written in memory in LE as: 41 00 20 00. If you imagine a pointer pointing to the first memory address, and the 'type' of pointer telling you how many bytes you'll be reading (short =2, int =4, char/byte=1) then obviously casting to a short will give you 41 00 (which is 0x0041 after flipping the bytes back in order) or a char of 0x41 since the first memory address stays the same. Big-Endian would store the number as is: 00 20 00 41, and would be pointing at the 0x00 which is now the first memory location, so you start casting to a short you end up with 0x0020 , or a char/byte would be 0x00
Your sample above (if I converted it right) in hex is: 0x03 4f 88 01; so casting to a short is simply 0x03 4F on a Big-Endian system and would be 0x 88 01 on a Little Endian System (stored as 01 88 4F 03, thus points to 01 88, which when read, reads as 0x8801)
Big-Endian is definitely more how 'humans' think about the numbers, while little-endian is nice for machines to work with
Taking your first post sample of the 2097217:
Hex (32 bit) this would be 00 20 00 41, written in memory in LE as: 41 00 20 00. If you imagine a pointer pointing to the first memory address, and the 'type' of pointer telling you how many bytes you'll be reading (short =2, int =4, char/byte=1) then obviously casting to a short will give you 41 00 (which is 0x0041 after flipping the bytes back in order) or a char of 0x41 since the first memory address stays the same. Big-Endian would store the number as is: 00 20 00 41, and would be pointing at the 0x00 which is now the first memory location, so you start casting to a short you end up with 0x0020 , or a char/byte would be 0x00
Your sample above (if I converted it right) in hex is: 0x03 4f 88 01; so casting to a short is simply 0x03 4F on a Big-Endian system and would be 0x 88 01 on a Little Endian System (stored as 01 88 4F 03, thus points to 01 88, which when read, reads as 0x8801)
Big-Endian is definitely more how 'humans' think about the numbers, while little-endian is nice for machines to work with


