G
Guest
Hi
I've just tried the following code
FileStream objFS = new FileStream(strFileName, FileMode.Open, FileAccess.Read)
BinaryReader objReader = new BinaryReader(objFS)
UInt32 intFirst = objReader.ReadUInt32()
UInt32 intSecond = 0xC5B8FF00
Now I know that the first four bytes in the file are C5 B8 FF 00 in that order, but when I compare intFirst with intSecond they don't match. On further investigation, intFirst contains 00FFB8C5. WTF?!?
Why is the Binary Reader reading the bytes in backwards? Is there a simple way to switch them the right way, or force the Binary Reader to read them properly
Burns x
I've just tried the following code
FileStream objFS = new FileStream(strFileName, FileMode.Open, FileAccess.Read)
BinaryReader objReader = new BinaryReader(objFS)
UInt32 intFirst = objReader.ReadUInt32()
UInt32 intSecond = 0xC5B8FF00
Now I know that the first four bytes in the file are C5 B8 FF 00 in that order, but when I compare intFirst with intSecond they don't match. On further investigation, intFirst contains 00FFB8C5. WTF?!?
Why is the Binary Reader reading the bytes in backwards? Is there a simple way to switch them the right way, or force the Binary Reader to read them properly
Burns x