我想要做的就是登錄我去使用使用用於記錄一個InputStream,然後XML解析
org.apache.http.HttpEntity entity = response.getEntity();
org.apache.http.HttpResponse content =entity.getContent();
//Print the result to the screen for debugging
//puroposes
if(Logging.DEBUG) {
InputStream content =entity.getContent();
int i;
StringBuilder b = new StringBuilder();
while((i=content.read()) != -1) {
b.append((char)i);
}
Log.d(TAG, b.toString());
}
從InputStream輸出現在我已經完成登錄後,我想用完全相同的流通過一個XML解析器。問題是它告訴我蒸汽已經被使用了。
我試過在調試之前和之後調用mark()
和reset()
,但它不起作用。
這工作,謝謝 – jax 2010-07-11 05:25:22
也許這個解決方案可能對某人有所幫助:http://shomeser.blogspot.com/2013/12/redirect-stream-to-logcat.html – 2013-12-24 12:36:13