I am using a TStream to read binary data (thanks to this post: How to use a TFileStream to read 2D matrices into dynamic array?).
My next problem is that the data is
Well, I don't know too much about byte swapping, but flipping a single bit is easy. XOR your value with a mask whose binary representation is all 0s, except for a 1 for the bit you want to flip. If you want the most significant bit, in hex that works out to $80
for a single byte, $8000
for a word and, you guessed it, $80000000
for a double word.