📄 openfile.java
字号:
import java.io.*;
/** This little class receives a file path and returns the text of the file.*/
class OpenFile{
private String s;
private byte b[];
OpenFile(String filename){
File f=new File(filename);
if(!f.exists()){
System.out.println("File does't exist");
return;
}
try{
FileInputStream fis=new FileInputStream(f);
b=new byte[(int)(f.length())];
fis.read(b);
}catch(Exception e){}
s=new String(b);
}
public String getFile(){
return s;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -