FileDocCategorySizeDatePackage
MultiCopier.javaAPI DocExample662Sat Feb 04 06:04:56 GMT 2006None

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;
    }

    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();