There is no way to automatically determine a file’s byte order. When creating a file format that stores multibyte values, it is important to pick a byte order and make it part of the file’s structure standard. Anyone reading that file should know what byte order it uses so that it can be read correctly. Many popular file formats have their byte order in their documentation.Data Structures and Algorithms for Game Developers: Allen Sherrod
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.