int count = 0; while (in.read() != -1) count++; System.out.println("Counted " + count + " chars.");
if (args.length >= 1) countChars(new FileInputStream(args[0])); else System.err.println("Usage: Count filename");