读书人

android中将读来的xml inputstream打印

发布时间: 2012-08-02 11:35:26 作者: rapoo

android中将读回的xml inputstream打印为日志

if(StringUtils.IsShowLog) {

try {

ByteArrayOutputStream os=new ByteArrayOutputStream();

byte[] b = new byte[4096]; ?

for (int n; (n = is.read(b)) != -1;) {

? ?StringUtils.logD(tag, ""+new String(b, 0, n));

? ?os.write(b, 0, n);

}

InputStream is_temp = new ByteArrayInputStream(os.toByteArray());

is = is_temp;

} catch (IOException e1) {

e1.printStackTrace();

} ??

}

读书人网 >XML SOAP

热点推荐