I’m trying to improve my understanding of the STFS file format by using a program to read all the different bits of information. Using a website with a reference of which offsets contain what information, I wrote some code that has a binary reader go through the file and place the values in the correct variables.
The problem is that all the data is SUPPOSED to be Big Endian, and everything the binary reader read is Little Endian. So, what’s the best way to go about fixing this?
Can I create a mimic class of Binary reader that returns a reversed array of bytes? Is there something I can change in class instance that will make it read in big endian so I don’t have to rewrite everything?
Any help is appreciated.
edit: I tried adding Encoding.BigEndianUnicode as a parameter, but it still reads little endian.
I’m not usually one to answer my own questions, but I’ve accomplished exactly what I wanted with some simple code:
I knew that’s what I wanted, but I didn’t know how to write it. I found this page and it helped: http://www.codekeep.net/snippets/870c4ab3-419b-4dd2-a950-6d45beaf1295.aspx