Nunca terminando de ler a resposta do servidor usando jSch

Eu estou tentando executar comandos no servidor unix, conectando-se através da biblioteca jSch0.1.49. Eu passei pelas amostras fornecidas pelo jSch e atéhttp://sourceforge.net/apps/mediawiki/jsch/index.php?title=Official_examples

Eu sou capaz de ler a resposta do servidor e imprimi-lo para o console, mas o loop é *nunca terminandog. Eu duvido porque o Channele não está fechando uma vez que é terminado de ler a resposta do servidor.

while (true) {
    while (inputStream.available() > 0) {
        int i = inputStream.read(buffer, 0, 1024);
        if (i < 0) {
            break;
        }
        System.out.print(new String(buffer, 0, i));//It is printing the response to console
    }
    System.out.println("done");// It is printing continuously infinite times

    if (channel.isClosed()) {//It is never closed 
        System.out.println("exit-status: " + channel.getExitStatus());
        break;
    }
    try{Thread.sleep(1000);}catch(Exception ee){}
}

questionAnswers(5)

yourAnswerToTheQuestion