I read online that serialization can be omitted for derived objects by declaring them as transient. But, in case of linked list the links are memory references between objects. So, should I convert it to array and store the array representation?
解决方案
Here's how Java serializes LinkedList: it fetches all elements and writes them to the ObjectOutputStream, together with the size. And of course declares the header entry transient
See the writeObject and readObject methods of LinkedList:
// Write out any hidden serialization magic
s.defaultWriteObject();
// Write out size
s.writeInt(size);
// Write out all elements in the proper order.
for (Entry e = header.next; e != header; e = e.next)
s.writeObject(e.element);