You might as well just write stream wrappers for the different versions.
So if the stuff written changes, give the file a different version number (written as an int as first into the file), you create a new stream wrapper for that version.
that allows you to keep them side a side.
That store blocks that are "blackboxes" to the reading mechanism and are parsed by a different class later.
Those blocks have their bytesize written first (in short or int) and then the data ... that way you can create a file of blackboxes that is immune to changes in the reading process.
Most likely simpler because the changes normally would be doen to the end of the writes of the old written data, so the reader could look if version >= needed version and then continue parsing or just set default data if < needed version.
So if the stuff written changes, give the file a different version number (written as an int as first into the file), you create a new stream wrapper for that version.
that allows you to keep them side a side.
That store blocks that are "blackboxes" to the reading mechanism and are parsed by a different class later.
Those blocks have their bytesize written first (in short or int) and then the data ... that way you can create a file of blackboxes that is immune to changes in the reading process.
Most likely simpler because the changes normally would be doen to the end of the writes of the old written data, so the reader could look if version >= needed version and then continue parsing or just set default data if < needed version.