In my basic understanding of ByteArrays the benefit is that it is smaller in file size.
The down size of a ByteArray is that for any given format you have to know the about the file format to get information out of it. You need a specification and software tools or software to find information.
For example, to get information about a JPEG you have to know what to look for (markers) and have knowledge of how to get that information (such as decoding a byte array, reading the bytes, looking for patterns, etc):
I've been working with XML and to me there are clear benefits. The main one is that it's human readable. So you can sometimes find information without knowing about the structure of a file format.
If we were to write the specification for JPEG now in XML it might look like this:
<s:Image xmlns="www.w3c.org" width="1000" height="600" bits="8"> <s:BitmapData>0F8320100830F0A0230B09CC0...</s:BitmapData> </s:Image>
My question is, if XML was created around the same time as the JPG and PNG and file size was not as much an issue (bandwidth was a huge issue in the early days of the internet) would they have used XML to save JPEG information or would they have chosen to write data to a byte array using specific markers for storing information?
What would you do if it was your choice?