Android从 HttpResponse (或者InputStream) 获取字符串内容的代码

当筵意气临九霄,星离雨散不终朝。这篇文章主要讲述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) 获取字符串内容的代码】}

    推荐阅读