Phil Wilson
11/7/2002 8:45:00 PM
One of the things you could think about is having a hosting object that contains something like an
ArrayList containing references to all the objects you care about. When you serialize this hosting
object to disk, it will (or you can make it) serialize all the objects in the ArrayList. To update
something, you serialize back from the file back into the hosting object, getting all your objects
back in the ArrayList. You then do whatever manipulation you need to the objects in the ArrayList,
then serialize the hosting object (and its contained objects) back to disk again. If you're
unwilling to use an actual database to store the individual objects (or write equivalent
functionality), I'd say you're pretty much stuck with the "read everything in, update it, write it
all out again" model.
"Amber Star" <amberalphastar@yahoo.com> wrote in message news:eloMrechCHA.2288@tkmsftngp12...
> Hi,
> I'm new to programming.. Can anyone steer me in the right direction. I want
> to searailize objects out to a binary file, and selectivly load and save
> them as individual objects into one file. What is the common technique for
> such functionality. Do I need to write an index out to keep track of the
> location of each object in the file.. What do I do if an object grows.. I
> don't want to write over the next object in the stream... Any help would be
> great!
>
> Thanks,
> Amber
>
>