这是我将数据写入文件的方式
FileOutputStream fos = openFileOutput("ThisWeekDatabase", Context.MODE_PRIVATE);
String Line;
while ((Line = thisWeekReader.readLine()) != null) {
fos.write(Line.getBytes());
}
fos.close();
这就是我试图读取同一个文件的方式
FileInputStream fIn = openFileInput ("ThisWeekDatabase") ;
InputStreamReader isr = new InputStreamReader ( fIn ) ;
BufferedReader buffreader = new BufferedReader ( isr ) ;
String Line;
while ((Line = buffreader.readLine ()) != null ) {
if (Line.contains("xyz")){
doSomething();
}
}
isr.close ( ) ;
但我得到java.io.FileNotFoundException