@Override
    public void beforeSample() {
	try {
	    // input
	    BufferedReader ir = getInputReader();
	    String line = ir.readLine();
	    if (line == null) {
		inputReader.close();
		inputReader = null;
		ir = getInputReader();
		line = ir.readLine();
	    }

	    String[] split = line.split(",");
	    if (nextInput == null) {
		nextInput = new float[split.length];
	    }

	    for (int i = 0; i < nextInput.length; i++) {
		nextInput[i] = Float.parseFloat(split[i]);
	    }

	    // target
	    if (targetFile != null) {
		BufferedReader tr = getTargetReader();
		line = tr.readLine();
		if (line == null) {
		    targetReader.close();
		    targetReader = null;
		    tr = getTargetReader();
		    line = tr.readLine();
		}
		
		split = line.split(",");
		if (nextTarget == null) {
		    nextTarget = new float[split.length];
		}

		for (int i = 0; i < nextTarget.length; i++) {
		    nextTarget[i] = Float.parseFloat(split[i]);
		}
	    }
	} catch (IOException e) {
	    e.printStackTrace();
	}
    }