@Override
    public void writeExternal(ObjectOutput out) throws IOException {
        ExternalizableUtil.getInstance().writeSerializable(out, jid);
        ExternalizableUtil.getInstance().writeBoolean(out, nickname != null);
        if (nickname != null) {
            ExternalizableUtil.getInstance().writeSafeUTF(out, nickname);
        }
        ExternalizableUtil.getInstance().writeStrings(out, groups);
        ExternalizableUtil.getInstance().writeStrings(out, sharedGroups);
        ExternalizableUtil.getInstance().writeStrings(out, invisibleSharedGroups);
        ExternalizableUtil.getInstance().writeInt(out, recvStatus.getValue());
        ExternalizableUtil.getInstance().writeInt(out, subStatus.getValue());
        ExternalizableUtil.getInstance().writeInt(out, askStatus.getValue());
        ExternalizableUtil.getInstance().writeLong(out, rosterID);
        ExternalizableUtil.getInstance().writeBoolean(out, subscribeStanza != null);
        if (subscribeStanza != null) {
            ExternalizableUtil.getInstance().writeXML(out, subscribeStanza.getElement());
        }
    }
<p>Update the cached item as a copy of the given item.</p>
<p>A convenience for getting the item and setting each attribute.</p>

@param item The item who's settings will be copied into the cached copy
@throws org.jivesoftware.openfire.SharedGroupException if trying to remove shared group.
xmppserver/src/main/java/org/jivesoftware/openfire/roster/RosterItem.java