FileDocCategorySizeDatePackage
FileTyper.javaAPI DocExample773Mon May 03 14:50:36 BST 1999None

FileTyper

public class FileTyper extends Object

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


    if (args.length == 0) {
      System.err.println("Usage: java FileTyper file1 file2 ...");
      return;
    }
    
    for (int i = 0; i < args.length; i++) {
      try {
        typeFile(args[i]);
        if (i+1 < args.length) { // more files to type
          System.out.println("\n------------------------------------");
        }   
      }
      catch (IOException e) {
        System.err.println(e);
      }
    }

  
public static voidtypeFile(java.lang.String filename)


    FileInputStream fin = new FileInputStream(filename);
    StreamCopier.copy(fin, System.out);
    fin.close();