android fileinputstream 获取file,Android FileInputStream没有读取文件
經(jīng)過數(shù)小時的淘洗后,我現(xiàn)在陷入困境..
我在使用Android從文件中讀取問題時,使用此方法執(zhí)行此操作的方法如下
private void open(String doc) throws IOException {
FileInputStream FIS = null;
InputStreamReader ISR = null;
try {
char[] inputBuffer = new char[1024];
String data = null;
FIS = openFileInput(doc);
ISR = new InputStreamReader(FIS);
ISR.read(inputBuffer);
data = new String(inputBuffer);
ISR.close();
FIS.close();
Globals.myText = data;
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}該文件通過以下方式傳入
else {
String doc = file.getName();
try {
open(doc);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Intent Open = new Intent(dir.this, Edit.class);
startActivity(Open);
}從通常的hacky調(diào)試開放方法捕獲
FIS = openFileInput(doc);我已經(jīng)用多種不同的方法嘗試了多個版本..它總是在閱讀器讀取文件時似乎跳躍到捕捉。
總結(jié)
以上是生活随笔為你收集整理的android fileinputstream 获取file,Android FileInputStream没有读取文件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: csv python 只写一次_在Pyt
- 下一篇: linux signal 符号表6,gd