-
You can’t append to an existing file created with an
ObjectOutputStream
, at least not without effort. There is a trick somewhere about extendingObjectOutputStream
and overriding thewriteStreamHeader()
method so as not to write the stream header the second time, but I’m not in favour of it. You should really rewrite the whole file, maybe as a List. -
You don’t need all this code. Just make
strokes
andcodes
non-static and non-transient, and get rid of thereadObject()
andwriteObject()
methods altogether.