public Instances getDataSet() throws IOException {
    Instances 		result;
    Vector<Double>	row;
    double[]		data;
    int			i;
    int			n;

    if (m_sourceReader == null)
      throw new IOException("No source has been specified");
    
    if (getRetrieval() == INCREMENTAL)
      throw new IOException("Cannot mix getting Instances in both incremental and batch modes");

    setRetrieval(BATCH);
    if (m_structure == null)
      getStructure();

    result = new Instances(m_structure, 0);

    // create instances from buffered data
    for (i = 0; i < m_Buffer.size(); i++) {
      row = m_Buffer.get(i);
      if (row.size() == 0)
	continue;
      data = new double[row.size()];
      for (n = 0; n < row.size(); n++)
	data[n] = row.get(n);
      
      result.add(new DenseInstance(1.0, data));
    }

    // close the stream
    try {
      m_sourceReader.close();
    }
    catch (Exception ex) {
      // ignored
    }
    
    return result;
  }