url.openStream(),也是先通过openConnection()方法获取URLConnection对象,然后调用getInputStream()方法。
贴url.openStream()源码:
public final InputStream openStream() throws java.io.IOException { return openConnection().getInputStream(); }
贴url.openStream()源码:
public final InputStream openStream() throws java.io.IOException { return openConnection().getInputStream(); }