url.openStream()和url.openConnection().getInputStream()两者区别

url.openStream(),也是先通过openConnection()方法获取URLConnection对象,然后调用getInputStream()方法。

贴url.openStream()源码:

public final InputStream openStream() throws java.io.IOException {
    return openConnection().getInputStream();
}
posted @ 2021-02-04 13:11  Kaspar_Choo  阅读(604)  评论(0编辑  收藏  举报