I would guess that you just remember at which file offsets you need to insert what, and which offset ranges you need to delete from the original file — and on file save you just do a single linear sweep to update the file contents on disk.
No comments yet.