//取得檔名
String fileName = "test";
int readed; //已讀取的位元數
String content=""; //內容
byte[] buff = new byte[256]; //input stream buffer
//Input stream
try{
FileInputStream reader = openFileInput(fileName);
while((readed = reader.read(buff))!=-1){
content+=new String(buff).trim();
}
}catch(FileNotFoundException e){
e.printStackTrace();
}catch (IOException e){
e.printStackTrace();
}
沒有留言:
張貼留言