Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I modify a serialized object which is stored in a file if the file contains a large number of objects?

0
Posted

How can I modify a serialized object which is stored in a file if the file contains a large number of objects?

0

Location: http://www.jguru.com/faq/view.jsp?EID=114601 Created: Jul 30, 2000 Modified: 2000-07-31 12:16:49.23 Author: Doug Bell (http://www.jguru.com/guru/viewbio.jsp?EID=113602) Question originally posed by balaji chittu (http://www.jguru.com/guru/viewbio.jsp?EID=95194 The short answer is that you probably can’t without deserializing the objects and reserializing and rewriting the objects. The serialized format is truly a stream-oriented protocol and does not support random access–it is both self-referential and incremental. When an object is written to the stream, a description of the class and its non-static and non-transient fields (including any Serializable superclasses and their non-static and non-transient fields) is also written to the steam. Then the entire object graph of non-transient fields of Serializable classes is written, which means that non-null object references to serializable objects are recursively serialized. Throughout this process, object identity is maintain

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123