首页 新闻 赞助 找找看

Java-io流

0
[已关闭问题] 关闭于 2018-11-09 21:21

package cn.task.day4;
import java.io.*;
public class text {
public static void main(String []args) throws FileNotFoundException {
File f1=new File("d:/FPX8341_bin.txt");
//File f2=new File("d:/a.txt");
//输入流
InputStream is=null;
is=new FileInputStream(f1);
//输出流
//OutputStream os=new FileOutputStream(f2);
//文件操作
byte [] bytes=new byte[1024];
int len=0;
try {
while((len=is.read(bytes, 0, 1024))!=-1){
String str=new String(bytes,0,len);
//String s=str.replaceAll("80", "");
//String r=s.trim();
System.out.println(str);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
为什么程序运行的时候,控制台什么都不输出,只是滚轮来回滑动。有时运行就好使,屏幕输出内容。请大神帮我回答一下。

Java,小白的主页 Java,小白 | 菜鸟二级 | 园豆:202
提问于:2018-07-11 08:35
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册