FileDocCategorySizeDatePackage
TeeCopier.javaAPI DocExample600Sat Feb 04 06:04:08 GMT 2006None

TeeCopier

public class TeeCopier extends Object

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


    if (args.length != 3) {
      System.out.println("Usage: java TeeCopier infile outfile1 outfile2");   
      return;
    }

    FileInputStream fin = new FileInputStream(args[0]);
    FileOutputStream fout1 = new FileOutputStream(args[1]);
    FileOutputStream fout2 = new FileOutputStream(args[2]);
    TeeOutputStream tout = new TeeOutputStream(fout1, fout2);
    BufferedStreamCopier.copy(fin, tout);
    fin.close();
    tout.close();