public int available() throws IOException Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread. The available method for class InputStream always returns 0. This method should be overridden by subclasses. Returns: the number of bytes that can be read from this input stream without blocking. Throws: IOException - if an I/O error occurs.available()方法是这么定义的,The available method for class InputStream always returns 0. 是什么意思? 为什么我换个url就能得到这个available值?
throws IOException
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread.
The available method for class InputStream always returns 0. This method should be overridden by subclasses.
Returns:
the number of bytes that can be read from this input stream without blocking.
Throws:
IOException - if an I/O error occurs.available()方法是这么定义的,The available method for class InputStream always returns 0. 是什么意思?
为什么我换个url就能得到这个available值?
in.available()看看是几,说不定就不是0了。