J2ME read txt file
来源:互联网 发布:整形医院网络主管 编辑:程序博客网 时间:2024/05/06 06:31
public void readfile(){
InputStream in = null;
DataInputStream dis = null;
in = this.getClass().getResourceAsStream("/string.txt");//from resource file
dis = new DataInputStream(in);
try{
int count = dis.available();
dis.mark(count+1);
dis.reset();
byte[] data = new byte[count];
for(int i=0;i<count;i++){
data[i] = dis.readByte();
}
String str = new String(data);
int i = str.indexOf(";");
String fileUrl = str.substring(0, i);
this.setUrl(fileUrl);
//the ";" is i, then "/n" to next line; so i+3 will be the first letter of next Line;
System.out.println(str+i);
System.out.println("sub string:");
System.out.println("url is: "+fileUrl);
}catch(Exception e){
System.out.println("error: "+e.toString());
}
}
- J2ME read txt file
- read .txt file
- xamarin ios read txt file
- IDL read table from a .txt file
- File Read
- read file
- J2ME Read Cookies
- J2ME TXT读取
- J2me创建txt文件
- Matlab read data from txt file and then cluster data using K-means
- 将日志重定向导出时提示:cannot create D:xx.txt: read-only file system
- read txt,ini
- Matlab Read Txt 文件
- j2me小说(txt)阅读器源码
- WebContent/WEB-INF/lib/readme.txt’ in project ‘xxxxxxxxx’ cannot be read or is not a valid ZIP file解
- Read .properties file
- Read .XML file
- db file sequential read
- Tag cloud 像云一样的tag
- Spring2.5 访问 Session 属性的四种策略
- SQL Server随机删除重复记录.txt
- oracle10g recyclebin 详解
- 世界因你不同
- J2ME read txt file
- 指针和引用的区别
- Visual Studio 2008常用快捷键
- JSF copy files
- 精妙SQL语句收集
- use J2SE compile jar file
- WEBLOGIC调优方案
- バーション確認(版本确认)
- win32编程,windows api,MFC和VC++关系杂谈