Working on a Map-building class I ran into a problem: how to build changes into a map without constantly buffering large sections of the map in order to insert new bytes.
What I came up with in a vague sort of way was to keep a lot of the map data in memory and write those buffers back into the map. At this time I am buffering some header information, index header data, index tags (class, meta offset, size, id), Filetable strings and index, ect. Basically I have the map all mapped out in memory, I have access to every pointer, ect, ect. But what I am spinning my wheels on is finding a good way to build the buffers back into the map in a dynamic way. Ideally I do not want to ever have to write changes into the map, but would like to 'rebuild' a copy of the map in a linear manor.
I'll try to update this post with some code once it out some more.