Re: [JSch-users] Unable to get out of while loop
Status: Alpha
Brought to you by:
ymnk
From: Lothar K. <jo...@ki...> - 2019-10-28 12:34:07
|
Am 28.10.2019 um 05:35 schrieb Abhimanu Handoo: > while(in.available()>0){ available() returns the number of bytes that can be read without blocking. I assume that this returns 0 all the time and because you don't do any attempt to actually read from the stream (leading to blocking) you never end the loop. BTW: > if(i<0)break; -1 is only returned if the end of stream is reached. Having this inside a block that is only entered after you know that there is data to be read (i.e. the end is not reached) makes no real sense. Cheers, Lothar |