// Source code example for "A Practical Introduction // to Data Structures and Algorithm Analysis" // by Clifford A. Shaffer, Prentice Hall, 1998. // Copyright 1998 by Clifford A. Shaffer import java.io.*; // A simple program to generate a large file of binary values. public class Genfile { static final int NumRec = 1024; public static void main(String args[]) throws IOException { Assert.notFalse(args.length == 2, "Usage: Genfile \nSize is measured in blocks of 4096 bytes"); int filesize = Integer.parseInt(args[1]); DataOutputStream file = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(args[0]))); int recs = 1024 * filesize - 1; for (int i=0; i