您的位置:首页 > 其它

182_08_IO流_FileInputStream_02

2017-04-30 11:56 253 查看
package TestIO;
import java.io.*;

public class Test01 {
public static void main(String[] args) throws Exception  {
////内容是:abcdef
String filepath= "D:\\test.txt";
FileInputStream  fis=null;
fis = new FileInputStream(filepath);
//第一种循环
//		  while(true){
//			  int temp = fis.read();
//		      if(temp == -1) break;
//		      System.out.println("temp--->"+temp);
//		  }
//第二种d
int temp=0;
while((temp =fis.read()) != -1){
System.out.println(temp);
}
fis.close();
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: