FileDocCategorySizeDatePackage
PrimeDriver.javaAPI DocExample626Sun Mar 28 07:20:18 BST 1999None

FibonacciDriver

public class FibonacciDriver extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


    int howMany;
    try {
      howMany = Integer.parseInt(args[0]);
    }
    catch (Exception e) {
      howMany = Integer.MAX_VALUE;
    }

    try {
      PipedOutputStream pout = new PipedOutputStream();
      PipedInputStream pin = new PipedInputStream(pout);

      FibonacciWriter fw = new FibonacciWriter(pout, howMany);
      FibonacciReader fr = new FibonacciReader(pin);
      fw.start();
      fr.start();
    }
    catch (IOException e) {
      System.err.println(e);
    }