當前位置:編程學習大全網 - 網站源碼 - android文件讀取需要異步嗎?

android文件讀取需要異步嗎?

string buffer buffer = new string buffer();try { file inputstream fis = new file inputstream("/SD card/XXX . txt ");InputStreamReader ISR = new InputStreamReader(fis,“GB 2312”);//文件編碼unicode,utf-8,ascii,gb2312,big 5 reader in = new buffered reader(ISR);int chwhile((ch = in . read())& gt;-1){ buffer . append((char)ch);} in . close();TV . settext(buffer . tostring());//buffer.toString())是讀取內容字符} catch(io exception e){ TV . settext("文件不存在!") }
  • 上一篇:如何讓蠟燭的火焰在瞬間移動
  • 下一篇:MJ指標怎麽設置
  • copyright 2024編程學習大全網