Data is not trivially copyable because it has a member of type string. It cannot be recreated by reinterpreting it as a char array and filling in some bytes from a file.
Wouldn't that specifically be ASCII file output? It looks like he wants binary output, in which case, I'm fairly certain you could get your code working by using a char array with a fixed size, instead of string, no?