code: public static void writeBinary(String featuresFileName, double[][] features) throws Exception {
  		DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(
  				featuresFileName)));
  		for (int i = 0; i < features.length; i++) {
  			for (int j = 0; j < features[i].length; j++) {
  				out.writeDouble(features[i][j]);
  			}
  		}
  		out.close();
  	}
docs: Takes a two-dimensional double array with features and writes them in a binary file.
  
  @param featuresFileName
  The binary file's name.
  @param features
  The features.
  @throws Exception