I used a HEX Editor and converted the binary file to BIG-endian format. And, then I ran the same parser code. It still returns garbage
So, keeping the original Binary File intact, while reading, how do I judge the native datatype for byte swapping order - because these n/w apis suggest something like this -
ntohs() - “network to host
short”
Converts the
unsigned short integer netshort from network byte order to host byte order.
ntohl() - “network to host
long”
Converts the
unsigned integer netlong from network byte order to host byte order.