import java.io.*;
public class Test{
public static void main(String args[])throws Exception{
File f = new File("D:" + File.separator + "f.txt");
FileInputStream in = new FileInputStream(f);
byte[] b = new byte[(int)f.length()];
in.read(b);
String temp = new String(b);
System.out.println(temp);
}
}
Java读取txt文件到String
最新推荐文章于 2023-04-11 14:06:46 发布