StringWriter writer = new StringWriter();
new StringReader(xml)
如果是用URLConnection,记得要设置超时时间,要不然一直占用资源不结束。
con.setConnectTimeout(30000); con.setReadTimeout(30000);