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();
}
时间: 2024-10-24 04:23:13