src/main/java/org/jivesoftware/smack/util/collections/AbstractReferenceMap.java
protected void doWriteObject(ObjectOutputStream out) throws IOException {
        out.writeInt(keyType);
        out.writeInt(valueType);
        out.writeBoolean(purgeValues);
        out.writeFloat(loadFactor);
        out.writeInt(data.length);
        for (MapIterator it = mapIterator(); it.hasNext();) {
            out.writeObject(it.next());
            out.writeObject(it.getValue());
        }
        out.writeObject(null); // null terminate map
        // do not call super.doWriteObject() as code there doesn't work for
        // reference map
    }
protected void doWriteObject(ObjectOutputStream out) throws IOException {
        out.writeInt(keyType);
        out.writeInt(valueType);
        out.writeBoolean(purgeValues);
        out.writeFloat(loadFactor);
        out.writeInt(data.length);
        for (MapIterator it = mapIterator(); it.hasNext();) {
            out.writeObject(it.next());
            out.writeObject(it.getValue());
        }
        out.writeObject(null); // null terminate map
        // do not call super.doWriteObject() as code there doesn't work for
        // reference map
    }
protected void doWriteObject ( ObjectOutputStream out ) throws IOException { out . writeInt ( keyType ) ; out . writeInt ( valueType ) ; out . writeBoolean ( purgeValues ) ; out . writeFloat ( loadFactor ) ; out . writeInt ( data . length ) ; for ( MapIterator it = mapIterator ( ) ; it . hasNext ( ) ; ) { out . writeObject ( it . next ( ) ) ; out . writeObject ( it . getValue ( ) ) ; } out . writeObject ( null ) ; // null terminate map // do not call super.doWriteObject() as code there doesn't work for // reference map }
Replaces the superclass method to store the state of this class.
<p/>
Serialization is not one of the JDK's nicest topics. Normal serialization
will initialise the superclass before the subclass. Sometimes however,
this isn't what you want, as in this case the <code>put()</code> method
on read can be affected by subclass state.
<p/>
The solution adopted here is to serialize the state data of this class in
this protected method. This method must be called by the
<code>writeObject()</code> of the first serializable subclass.
<p/>
Subclasses may override if they have a specific field that must be
present on read before this implementation will work. Generally, the read
determines what must be serialized here, if anything.

@param out
the output stream
Replaces the superclass method to store the state of this class . <p / > Serialization is not one of the JDK s nicest topics . Normal serialization will initialise the superclass before the subclass . Sometimes however this isn t what you want as in this case the <code > put () < / code > method on read can be affected by subclass state . <p / > The solution adopted here is to serialize the state data of this class in this protected method . This method must be called by the <code > writeObject () < / code > of the first serializable subclass . <p / > Subclasses may override if they have a specific field that must be present on read before this implementation will work . Generally the read determines what must be serialized here if anything .