I've searched a lot for an answer but I still couldn't come up with a simple answer.
I'm trying to parse bytes (stored in NSData) into several data types.
For example, parse 6 bytes to a NSUInteger and short.
I read the iPhone works with little endian, but I don't want to rely on it. I would like to treat the data like little endian, but validate the device indeed works with little endian (otherwise swap the data to big endian).
So:
1. How do I parse data to primitive types, considering endianness?
2. How do I check the endianness on the device?
Thanks !!