public static void generateOutputFile ( Random rng , File outputFile ) throws IOException { DataOutputStream dataOutput = null ; try { dataOutput = new DataOutputStream ( new BufferedOutputStream ( new FileOutputStream ( outputFile ) ) ) ; for ( int i = 0 ; i < INT_COUNT ; i ++ ) { dataOutput . writeInt ( rng . nextInt ( ) ) ; } dataOutput . flush ( ) ; } finally { if ( dataOutput != null ) { dataOutput . close ( ) ; } } }
Generates a file of random data in a format suitable for the DIEHARD test . DIEHARD requires 3 million 32 - bit integers .