C#でCの構造体を直接はいたようなファイルを読み込もうと思って、こんな感じのをちょっと書いてみたり。

static class Extensions
{
    public static T ReadStruct<T>(this BinaryReader reader) where T : struct
    {
        Byte[] bytes = new Byte[Marshal.SizeOf(typeof(T))];
        reader.Read(bytes, 0, bytes.Length);
        
        GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
        try
        {
            return (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T));
        }
        finally
        {
            handle.Free();
        }
    }
}

reader.ReadStruct<FooStruct>();という感じで構造体をBinaryReaderから吸い上げます。