public void restart() {
        try {
            if (this.fileReader != null) {
                this.fileReader.close();
            }
            if (this.uStreamReceiver != null) {
                if (this.uStreamReceiver.isSockBound()) {
                    this.uStreamReceiver.closeSocket();
                }
            }

            InputStream fileStream = new FileInputStream(this.arffFileOption
                    .getFile());

            this.fileProgressMonitor = new InputStreamProgressMonitor(
                    fileStream);

            this.fileReader = new BufferedReader(new InputStreamReader(
                    this.fileProgressMonitor));
            ArffReader arff = new ArffReader(fileReader, 0);

            this.instances = arff.getStructure();
            this.activeInstances = arff.getStructure();

            if (this.classIndexOption.getValue() < 0) {
                this.instances
                        .setClassIndex(this.instances.numAttributes() - 1);
                this.activeInstances
                        .setClassIndex(this.activeInstances.numAttributes() - 1);
            } else if (this.classIndexOption.getValue() > 0) {
                this.instances
                        .setClassIndex(this.classIndexOption.getValue() - 1);
                this.activeInstances
                        .setClassIndex(this.classIndexOption.getValue() - 1);
            }

            this.numInstancesRead = 0;
            this.lastInstanceRead = null;
            uStreamReceiver = new UDPStreamReceiver(portOption.getValue(), packetSizeOption.getValue());
            uStreamReceiver.openSocket(socketTimeoutOption.getValue());
            if (checkHostOption.isSet()) {
                if (hostOption.getValue() != null && hostOption.getValue().length() > 7) {
                    InetAddress address = InetAddress.getByName(hostOption.getValue());
                    uStreamReceiver.putHostConstraint(address);
                } else {
                    InetAddress address = InetAddress.getByName(hostOption.getValue());
                    uStreamReceiver.putHostConstraint(address);
                }
            }
            this.endOfStream = !recieveNextInstanceFromStream();
        } catch (IOException ioe) {
            throw new RuntimeException("UDPStream restart failed.", ioe);
        }
    }