效果一样的。 可以看看API: ====================== openStreampublic final InputStream openStream() throws IOException Opens a connection to this URL and returns an InputStream for reading from that connection. This method is a shorthand for: openConnection().getInputStream() Returns: an input stream for reading from the URL connection. Throws: IOException - if an I/O exception occurs. See Also: openConnection(), URLConnection.getInputStream()====================== getInputStreampublic InputStream getInputStream() throws IOException Returns an input stream that reads from this open connection. A SocketTimeoutException can be thrown when reading from the returned input stream if the read timeout expires before data is available for read. Returns: an input stream that reads from this open connection. Throws: IOException - if an I/O error occurs while creating the input stream. UnknownServiceException - if the protocol does not support input. See Also: setReadTimeout(int), getReadTimeout()
可以看看API:
======================
openStreampublic final InputStream openStream()
throws IOException Opens a connection to this URL and returns an InputStream for reading from that connection. This method is a shorthand for: openConnection().getInputStream()
Returns:
an input stream for reading from the URL connection.
Throws:
IOException - if an I/O exception occurs.
See Also:
openConnection(), URLConnection.getInputStream()======================
getInputStreampublic InputStream getInputStream()
throws IOException Returns an input stream that reads from this open connection. A SocketTimeoutException can be thrown when reading from the returned input stream if the read timeout expires before data is available for read. Returns:
an input stream that reads from this open connection.
Throws:
IOException - if an I/O error occurs while creating the input stream.
UnknownServiceException - if the protocol does not support input.
See Also:
setReadTimeout(int), getReadTimeout()