c语言程序设计 现代方法 第二版 课后答案 (美 K.N.king)

求该书的答案!!谢谢
2024-11-22 17:16:20
推荐回答(1个)
回答1:

if (entity != null) {
final InputStream instream = entity.getContent();
try {
final StringBuilder sb = new StringBuilder();
final char[] tmp = new char[1024];
final Reader reader = new InputStreamReader(instream,encoding);
int l;
while ((l = reader.read(tmp)) != -1) {
sb.append(tmp, 0, l);
}
body = sb.toString();
} finally {
instream.close();
EntityUtils.consume(entity);
}