读取android手机流量信息(4)
{
if(netdata[k].length()>0)
{
gprsdata[j]=netdata[k];
j++;
}
}
}
else if(line.startsWith(WIFILINE))
{
netdata=segs[1].trim().split(" ");
for(k=0,j=0;k<netdata.length;k++)
{
if(netdata[k].length()>0)
{
wifidata[j]=netdata[k];
j++;
}
}
}
count++;
}
fstream.close();
}
catch (IOException e) {
DisplayToast(e.toString());
}
}
public String getinfo(String path)
{
File file;
String str="";
FileInputStream in;
try{
//打开文件file的InputStream
file = new File(path);
in = new FileInputStream(file);
//将文件内容全部读入到byte数组
int length = (int)file.length();
byte[] temp = new byte[length];
in.read(temp, 0, length);
//将byte数组用UTF-8编码并存入display字符串中
str = EncodingUtils.getString(temp,TEXT_ENCODING);
//关闭文件file的InputStream
相关新闻>>
- 发表评论
-
- 最新评论 更多>>