Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. The next invocation might be the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes.
Note that while some implementations of {@code InputStream} will returnthe total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream.
A subclass' implementation of this method may choose to throw an {@link IOException} if this input stream has been closed byinvoking the {@link #close()} method.
The {@code available} method for class {@code InputStream} alwaysreturns {@code 0}.
@return an estimate of the number of bytes that can be read (or skippedover) from this input stream without blocking or {@code 0} whenit reaches the end of the input stream.
@exception IOException if an I/O error occurs.