*
* @param path
* @return
* @throws Exception
*/
public String readXmlForString(String path) throws Exception{
InputStream in = XNetService.class.getResourceAsStream(path);
Reader reader = new InputStreamReader(in);
BufferedReader bf=new BufferedReader(reader);
StringBuffer str=new StringBuffer();
String row=null;
while(null!=(row=bf.readLine())){
if(!row.equals("")){
str.append(row).append("\n");
}
}
String string = str.toString();
return string;
}
原文链接:https://www.f2er.com/xml/300461.html