@Override
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        jid = (JID) ExternalizableUtil.getInstance().readSerializable(in);
        if (ExternalizableUtil.getInstance().readBoolean(in)) {
            nickname = ExternalizableUtil.getInstance().readSafeUTF(in);
        }
        this.groups = new LinkedList<>();
        ExternalizableUtil.getInstance().readStrings(in, groups);
        ExternalizableUtil.getInstance().readStrings(in, sharedGroups);
        ExternalizableUtil.getInstance().readStrings(in, invisibleSharedGroups);
        recvStatus = RecvType.getTypeFromInt(ExternalizableUtil.getInstance().readInt(in));
        subStatus = SubType.getTypeFromInt(ExternalizableUtil.getInstance().readInt(in));
        askStatus = AskType.getTypeFromInt(ExternalizableUtil.getInstance().readInt(in));
        rosterID = ExternalizableUtil.getInstance().readLong(in);
        if (ExternalizableUtil.getInstance().readBoolean(in)) {
            subscribeStanza = new Presence(ExternalizableUtil.getInstance().readXML(in));
        }
    }
<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