I'm reading a binary file using BinaryReader from System.IO in C#, however, when using ReadString it doesn't read the first byte, here is the code:
using (var b = new BinaryReader(File.Open(open.FileName, FileMode.Open)))
{
int version = b.ReadInt32();
int chunkID = b.ReadInt32();
string objname = b.ReadString();
}
Is not something really hard, first it reads two ints, but the string that is supposed to return the objame is "bat", and instead it returns "at".
Does this have something to do with the two first ints i did read? Or maybe beacause there isn't a null byte between the first int and the string?
Thanks in advance.