docs: public static <Type extends DataSet<Type>> void writeData(DataSet<Type> dataset, OutputStream outRaw, FloatStorageMethod fpStore) throws IOException
      {
          fpStore = FloatStorageMethod.getMethod(dataset, fpStore);
          
          DataWriter.DataSetType type;
          CategoricalData predicting;
          if(dataset instanceof ClassificationDataSet)
          {
              type = DataWriter.DataSetType.CLASSIFICATION;
              predicting = ((ClassificationDataSet)dataset).getPredicting();
          }
          else if(dataset instanceof RegressionDataSet)
          {
              type = DataWriter.DataSetType.REGRESSION;
              predicting = null;
          }
          else
          {
              type = DataWriter.DataSetType.SIMPLE;
              predicting = null;
          }
          
          DataWriter dw = getWriter(outRaw, dataset.getCategories(), dataset.getNumNumericalVars(), predicting, fpStore, type);
          
          //write out all the datapoints
          for(int i = 0; i < dataset.size(); i++)
          {
              double label = 0;
              if (dataset instanceof ClassificationDataSet)
                  label = ((ClassificationDataSet) dataset).getDataPointCategory(i);
              else if (dataset instanceof RegressionDataSet)
                  label = ((RegressionDataSet) dataset).getTargetValue(i);
              dw.writePoint(dataset.getWeight(i), dataset.getDataPoint(i), label);
          }
          
          dw.finish();
          outRaw.flush();
      }