您的位置:首页 > 运维架构 > Shell

Linux学习笔记3.2-bash特性详解

2014-02-03 11:22 627 查看
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");

}
}


很简单的文件,但是就是没有输出结果,也没有任何的错误提示!初步怀疑是被阻塞了,但是不知道在哪里?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: