readSDFile

时间:2015-07-07 11:02:10   收藏:0   阅读:109

public String readSDFile(String filePath)
{
StringBuffer sb = new StringBuffer();
File file = new File(filePath);
try
{
FileInputStream fis = new FileInputStream(file);
int c;
while ((c = fis.read()) != -1)
{
sb.append((char) c);
}
fis.close();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
return sb.toString();
}

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!