我正在使用下面的代码来读取我的文件,它工作正常,但现在我想向该文件添加新文本。请帮我
private void loadingDictionary() {
// TODO Auto-generated method stub
AssetManager mgr;
try{
mgr = getAssets();
InputStream is = mgr.open("dictinary.txt");
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
StringBuilder stringBuilder = new StringBuilder();
String ls = ",";
while(( line = br.readLine() ) != null){
stringBuilder.append( line );
stringBuilder.append( ls );
}
dictinaryLines = stringBuilder.toString();
dictLinesArray = dictinaryLines.split(ls);
}
catch(IOException e1){
}
}
我想将新文本附加到现有数据中。请帮我。