import java.awt.*; import java.applet.*; import java.net.*; import java.io.*; import java.util.*; /* usage: jview Probel.class c:\ autoexec.bat */ public class Probel { public static void main(String args[]){ int count=0; int total=0; File f= new File (args[0],args[1]); //directory, file try{ Reader in = new FileReader(f); //otkrqt' fail char[] buff = new char[4096]; //buffer int nch; //koli4estvo pro4itannqh bait ne bolee 4096 while ((nch = in.read(buff)) != -1) { System.out.print("."); total+=nch; for(int i = 0; i < nch; i++){ if (((byte)buff[i]) == 32) count++; //32 - kod probela } } } catch (Exception e) { System.err.println(e.toString()); }; System.out.println(); System.out.println("total:" +total +", probelov:" + count); } }