如何读取HTTP输入流?
- 论坛
- 如何读取HTTP输入流?
12 浏览
如何读取HTTP输入流?
下面的代码是从Javadocs上HttpURLConnection
复制而来的。
我遇到了以下错误:
readStream(in)
...因为没有这样的方法。
在URLConnection.getInputStream
的类概述中也有同样的情况。
readStream
在哪里?以下是提供的代码片段:
URL url = new URL("http://www.android.com/"); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { InputStream in = new BufferedInputStream(urlConnection.getInputStream()); readStream(in); <-----没有这样的方法 } finally { urlConnection.disconnect(); }