FileDocCategorySizeDatePackage
MultiCopier.javaAPI DocExample754Sun Mar 28 19:06:18 BST 1999None

MultiCopier

public class MultiCopier extends Object

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


    if (args.length < 2) {
      System.out.println("Usage: java MultiCopier infile outfile1 outfile2...");   
      return;
    }

    try {
      FileInputStream fin = new FileInputStream(args[0]);
      FileOutputStream fout1 = new FileOutputStream(args[1]);
      MultiOutputStream mout = new MultiOutputStream(fout1);
      for (int i = 2; i < args.length; i++) {
        mout.addOutputStream(new FileOutputStream(args[i]));      
      }
      BufferedStreamCopier.copy(fin, mout);
      fin.close();
      mout.close();
    }
    catch (IOException e) {
      System.err.println(e);    
    }