code: 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();
              }
          }
      }
docs: Generates a file of random data in a format suitable for the DIEHARD test.
  DIEHARD requires 3 million 32-bit integers.
  @param rng The random number generator to use to generate the data.
  @param outputFile The file that the random data is written to.
  @throws IOException If there is a problem writing to the file.