package day08;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
/**
* java.io.FileInputStream
* 文件输入流
* 用于从文件中读取数据
* @author soft01
*
*/
public class FISDemo {
public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream("fos.txt");
byte [] data = new byte[100];
int len = fis.read(data);
String str = new String(data,0,len,"UTF-8");
System.out.println(str);
fis.close();
}
}
JAVA学习day81--文件输入流
最新推荐文章于 2022-06-23 10:13:32 发布