While working with binary files, how do you measure their endianness?
For example, if a programmer is making configuration file in binary format (e.g. on small systems it may not be possible to use XML like text files for configuration, text files require another wrapper/layer over binary files), the same binary file would need to be read on different architectures. In such case endianness issue to be addressed.
Or consider, a binary file is created on little endian machine, can it be read on big endian machine without altering byte order?
We can consider binary file as sequence of increasing addresses starting from low order to high order, each address can store one byte. If we are writing some data to binary file on little endian machine it need not to be altered. Where as if the binary file to be created on big endian machines, the data to be altered.
Note that some file formats define endian ordering. Example are JPEG (big endian) and BMP (little endian).
Article compiled by Venki. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- PostgreSQL - ORDER BY clause
- Find k-th bit in a binary string created by repeated invert and append operations
- Best meeting point in 2D binary array
- Rethinking binary with Quantum computers
- Tutorial on Binary Search Tree
- Univariate, Bivariate and Multivariate data and its analysis
- Look-and-Say Sequence
- How to add articles to "To Do" and "Done" lists on GeeksforGeeks?
- Finding the number of triangles amongst horizontal and vertical line segments
- MouseListener and MouseMotionListener in Java
- Shuffle a pack of cards and answer the query
- fgets() and gets() in C language
- vector::push_back() and vector::pop_back() in C++ STL
- deque::clear() and deque::erase() in C++ STL
- Check whether the number has only first and last bits set | Set 2
- DFA in LEX code which accepts even number of zeros and even number of ones
- Difference between Information and Data
- ISRO original papers and official Keys
- Election algorithm and distributed processing
- The Internet and the Web