import java.io.*;
public class CountBytes {
public static void main(String[] args) throws IOException{
InputStream in;
if(args.length==0)
in=System.in;
else
in=new FileInputStream(args[0]);
int total=0;
while(in.read()!=-1)
total++;
System.out.println(total+"bytes");
}
}
很简单的文件,但是就是没有输出结果,也没有任何的错误提示!初步怀疑是被阻塞了,但是不知道在哪里?