code: public AttributeDataset parse(String name, InputStream stream) throws IOException, ParseException {
          BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
  
          String line = reader.readLine();
          if (line == null) {
              throw new IOException("Empty data source.");
          }
  
          String[] tokens = line.split("\t", -1);
          int start = 1;
          int p = tokens.length - 1;
          if (tokens[1].equalsIgnoreCase("description")) {
              start = 2;
              p = tokens.length - 2;
          }
  
          Attribute[] attributes = new Attribute[p];
          for (int i = 0; i < p; i++) {
              attributes[i] = new NumericAttribute(tokens[i+start]);
          }
          
          AttributeDataset data = new AttributeDataset(name, attributes);
          
          for (int i = 2; (line = reader.readLine()) != null; i++) {
              tokens = line.split("\t", -1);
              if (tokens.length != p+start) {
                  throw new IOException(String.format("Invalid number of elements of line %d: %d", i, tokens.length));
              }
  
              double[] x = new double[p];
              for (int j = 0; j < p; j++) {
                  if (tokens[j+start].isEmpty()) {
                      x[j] = Double.NaN;
                  } else {
                      x[j] = Double.valueOf(tokens[j+start]);
                  }
              }
  
              AttributeDataset.Row datum = data.add(x);
              datum.name = tokens[0];
              if (start == 2) {
                  datum.description = tokens[1];
              }
          }
          
          reader.close();
          return data;
      }
docs: Parse a TXT dataset from an input stream.
  @param name the name of dataset.
  @param stream the input stream of data.
  @throws java.io.IOException