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 ( ) ; }
Takes a two - dimensional double array with features and writes them in a binary file .