code: public static ArrayList<double[]> readBinary(String featuresFileName, int featureLength) throws Exception {
  		ArrayList<double[]> features = new ArrayList<double[]>();
  		DataInputStream in = new DataInputStream(new BufferedInputStream(
  				new FileInputStream(featuresFileName)));
  
  		int counter = 0;
  		double[] desc = new double[featureLength];
  		while (true) {
  			try {
  				desc[counter] = in.readDouble();
  			} catch (EOFException e) {
  				break;
  			}
  			counter++;
  			if (counter == featureLength) {
  				features.add(desc);
  				counter = 0;
  				desc = new double[featureLength];
  			}
  		}
  		in.close();
  		return features;
  	}
docs: Reads features from a binary file and returns them in an ArrayList<double[]>.
  
  @param featuresFileName
  The binary file containing the features.
  @param featureLength
  The length of each feature.
  @return
  @throws Exception