public void writeExternal(ObjectOutput out) throws IOException {
        ExternalizableUtil.getInstance().writeBoolean(out, address != null);
        if (address != null) {
            ExternalizableUtil.getInstance().writeSerializable(out, address);
        }
        ExternalizableUtil.getInstance().writeBoolean(out, streamID != null);
        if (streamID != null) {
            ExternalizableUtil.getInstance().writeSafeUTF( out, streamID.getID() );
        }
        ExternalizableUtil.getInstance().writeInt(out, sessionType.ordinal());
        if (packet instanceof IQ) {
            ExternalizableUtil.getInstance().writeInt(out, 1);
        } else if (packet instanceof Message) {
            ExternalizableUtil.getInstance().writeInt(out, 2);
        } else if (packet instanceof Presence) {
            ExternalizableUtil.getInstance().writeInt(out, 3);
        }
        ExternalizableUtil.getInstance().writeSerializable(out, (DefaultElement) packet.getElement());
    }
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