readSDFile

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();
}

posted @ 2015-07-07 10:39  栗子a  阅读(112)  评论(0编辑  收藏  举报