当筵意气临九霄,星离雨散不终朝。这篇文章主要讲述Android从 HttpResponse (或者InputStream) 获取字符串内容的代码相关的知识,希望能为你提供帮助。
将写内容过程比较好的内容做个记录,下面的资料是关于android从 HttpResponse (或者InputStream) 获取字符串内容的内容,应该对码农有些好处。
private StringBuilder inputStreamToString(InputStream is) {
String line = "
"
;
StringBuilder total = new StringBuilder();
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
while ((line = rd.readLine()) != null) {
total.append(line);
}return total;
}
private String inputStreamToString(InputStream is) {
String s = " " ;
String line = " " ;
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
while ((line = rd.readLine()) != null) { s += line;
}return s;
【Android从 HttpResponse (或者InputStream) 获取字符串内容的代码】}
推荐阅读
- Android Studio错误日志-注解报错Annotation processors must be explicitly declared now.
- Android Protobuf应用及原理
- Android移动客户端性能测试浅谈——电量
- 自己动手写Android VIP视频解析APP
- Qt做发布版,解决声音和图片中文字体乱码问题(需要在main里写上QApplication::addLibraryPath("./plugins")才能加载图片,有图片,很清楚)
- CMU-CSAPP-Lab2拆解二进制炸弹
- Android-Activity启动模式(launchMode)
- leetcode 448 Find All Numbers Disappeared in an Array
- html调用安卓提示音报错E/MediaPlayerNative: error(-38, 0),E/MediaPlayerNative: error(1, -19)