⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readfile.java

📁 java手机程序开发随书光盘源代码
💻 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 + -