public void readExternal(ObjectInput in) throws IOException {
        if (ExternalizableUtil.getInstance().readBoolean(in)) {
            address = (JID) ExternalizableUtil.getInstance().readSerializable(in);
        }
        if (ExternalizableUtil.getInstance().readBoolean(in)) {
            streamID = BasicStreamIDFactory.createStreamID( ExternalizableUtil.getInstance().readSafeUTF(in) );
        }
        sessionType = SessionType.values()[ExternalizableUtil.getInstance().readInt(in)];
        int packetType = ExternalizableUtil.getInstance().readInt(in);
        Element packetElement = (Element) ExternalizableUtil.getInstance().readSerializable(in);
        switch (packetType) {
            case 1:
                packet = new IQ(packetElement, true);
                break;
            case 2:
                packet = new Message(packetElement, true);
                break;
            case 3:
                packet = new Presence(packetElement, true);
                break;
        }
    }
Cluster task that will ask a remote cluster node to deliver some packet to a local session.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/session/ProcessPacketTask.java