Android读取响应,并转换为字符

HttpEntity httpEntity = response.getEntity();
			InputStream in = httpEntity.getContent();
			InputStreamReader reader = new InputStreamReader(in,charSet);
			BufferedReader bread = new BufferedReader(reader);
			char[] buf = new char[1024];
			StringBuffer buffer = new StringBuffer();
			int count = 0;
			while((count = bread.read(buf))!= -1){
				buffer.append(buf,0,count);
			}

你可能感兴趣的:(Android读取响应,并转换为字符)