You need to know the type of data you are dealing with. For example, if you want to open a .wav file, you find the specification (https://ccrma.stanford.edu/courses/422-winter-2014/projects/WaveFormat/) and then you write your program to the specification.
It says first 4 bytes are the ID, then next 4 bytes are the size, then next 4 are the format… etc. etc. etc.
If somebody just hands you a blob of data and tells you to interpret it, then you are correct to be confused. You’d have no idea what the bytes mean.
Also, if you open a file in the wrong program, it interprets the bytes in the wrong way and you just get nonsense. Open a .exe file in notepad and it’s just crazy characters all over the screen.
Latest Answers