我正在尝试从流式 URL 使用 JSON 数据
代码片段如下
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(new HttpGet(url));
if(response.getEntity().isStreaming() ){
while (true) {
BufferedHttpEntity _entity = new BufferedHttpEntity(response.getEntity());
InputStream _stream = _entity.getContent();
JSONObject _interaction = new JSONObject(_stream.toString());
System.out.println(_interaction.toString());
}
}
请指导我在没有任何外部库的情况下使用它
提前致谢