I want to read structures from binary. In C++ I would do it like this:
stream.read((char*)&someStruct, sizeof(someStruct));
Is there a similar way in C#? The BinaryReader only works for built-in types. In .NET 4 there is a MemoryMappedViewAccessor. It provides methods like Read<T> which seems to be what I want, except that I manually have to keep track of where in the file I want to read.
Is there a better way?


