📄 readfile.java
字号:
import javax.microedition.midlet.*;
import java.io.*;
public class ReadFile extends MIDlet{
InputStream is = null;
DataInputStream din = null;
String fileName;
public ReadFile(){
fileName = getAppProperty("Test-File-Name");
is = getClass().getResourceAsStream(fileName);
din = new DataInputStream(is);
}
public void startApp(){
int l;
byte[] buffer;
int c;
try{
l = din.available();
buffer = new byte[l+1];
}
catch(Exception ex){
buffer = new byte[10];
}
try{
while((c = is.read()) != -1) {
System.out.print(""+(char)c);
}
System.out.println("");
}catch(Exception ex){}
}
public void pauseApp(){
}
public void destroyApp(boolean unconditional){
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -