Forcing different Serialization/Externalization for identical references

G

GG

Hi all,

How would one force a deep reserialization for a collection whose
reference
is already known to be serialized by ObjectOutputStream (without using
custom
mechanisms, of course; in that case there's no question, is there?).

For example, I am trying to serialize a large number (hundreds of
thousands) of rows of a database, that I store as a List. Now, if I do
..clear() and try to serialize again, I would get the same result back
as the first thing I serialized. But if I create a "new" object every
time, I run out of memory pretty fast. Is there a standard way, or
should I roll my own solution?
 
R

Roedy Green

How would one force a deep reserialization for a collection whose
reference
is already known to be serialized by ObjectOutputStream (without using
custom
mechanisms, of course; in that case there's no question, is there?).

see reset method. That makes it forget about all the objects earlier
in the stream.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top