FileInputStream f = new FileInputStream(fileName); byte[] buf = new byte[f.available()]; f.read(buf, 0, f.available()); //一次读入 String str = new String(buf);
FileInputStream file = new FileInputStream(fileName); byte[] buf = new byte[file.available()]; file.read(buf, 0, file.available()); //一次性读入 String str = new String(buf);多谢!受教了!
byte[] buf = new byte[f.available()];
f.read(buf, 0, f.available()); //一次读入
String str = new String(buf);
byte[] buf = new byte[file.available()];
file.read(buf, 0, file.available()); //一次性读入
String str = new String(buf);多谢!受教了!