public String openFileAsStr(String strPathFile){
StringBuffer strTmp = new StringBuffer();
String substr = null;
try{
java.io.FileInputStream fis = new java.io.FileInputStream(strPathFile);
java.io.InputStreamReader ireader = new java.io.InputStreamReader(fis);
java.io.BufferedReader breader = new java.io.BufferedReader(ireader);
while( (substr = breader.readLine())!=null){
strTmp.append(substr);
substr = null;
}
breader.close();
ireader.close();
fis.close();
}catch(Exception ex){
System.out.println(ex);
return null;
}
return (strTmp == null)? null : strTmp.toString();
}
阅读(1130) | 评论(0) | 转发(0) |