/*
  Randtest.java : Testing compression of numbers generated by 
                  pseudo random number generator
*/
import java.io.*;
import java.util.Random;

class Randtest {
  public static void main(String[] args) {

    try {
      DataOutputStream out;
      FileOutputStream fos = new FileOutputStream ( "randnums" );
      out = new DataOutputStream( fos );
      Random generator = new Random();
      for ( int i = 0; i  < 10000000; ++i ) {
   	int r = generator.nextInt();
	out.writeInt ( r );
      }
      out.close();
    } catch ( Exception e ) {
      System.err.println("apply: "+e.toString() );
    }
    System.out.println("Random numbers saved in 'randnums'!");
  }
}
  
