Java输入阅读器 - 链接输入流API

时间:2015-05-03 18:31:05

标签: java url streaming urlconnection

两种流链接方法有什么区别?

首先:

            BufferedReader br = new BufferedReader(
                    new InputStreamReader(someUrlConnection.getInputStream(), encoding));

第二:

            InputStream raw = someUrlConnection.getInputStream();
            InputStream buffer = new BufferedInputStream(raw);
            Reader reader = new InputStreamReader(buffer);

0 个答案:

没有答案