FileDocCategorySizeDatePackage
Count.javaAPI DocExample488Tue Dec 12 18:59:46 GMT 2000None

Count

public class Count extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidcountChars(java.io.InputStream in)

        int count = 0;

        while (in.read() != -1)
            count++;

        System.out.println("Counted " + count + " chars.");
    
public static voidmain(java.lang.String[] args)

        if (args.length >= 1)
            countChars(new FileInputStream(args[0]));
        else
            System.err.println("Usage: Count filename");