Sagewire Logo

Forcing different Serialization/Externalization for identical references

2 Message(s) by 2 Author(s) originally posted in java misc


From: grisha Date:   Wednesday, July 14, 2004
Hi all,

How'd one force a deep reserialization for a collection whose
reference
is already known to be serialize d 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'd 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?


From: Roedy Green Date:   Wednesday, July 14, 2004
wrote in message or
quoted :

How'd 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.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The JAVA Glossary.



Next Message: converting from decimal to any bae



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional