@ Override public synchronized int available ( ) throws IOException { final InputStream localIn = in ; // 'in' could be invalidated by close() if ( buf == null || localIn == null ) { throw new IOException ( "Stream is closed" ) ; } return count - pos + localIn . available ( ) ; }
Returns the number of bytes that are available before this stream will block . This method returns the number of bytes available in the buffer plus those available in the source stream .