code: private int checkAck() throws IOException {
          logger.trace( "wait for ack" );
          int b = inputStream.read();
          logger.debug( "ack response: '{}'", b );
  
          if ( b == 1 || b == 2 ) {
              StringBuilder sb = new StringBuilder();
              int c;
              while ( (c = inputStream.read()) != '\n' ) {
                  sb.append( (char) c );
              }
              if ( b == 1 || b == 2 ) {
                  throw new IOException( sb.toString() );
              }
          }
  
          return b;
      }
docs: Throws an JSchIOException if ack was in error. Ack codes are:
  
  <pre>
  0 for success,
  1 for error,
  2 for fatal error
  </pre>
  
  Also throws, IOException if unable to read from the InputStream. If
  nothing was thrown, ack was a success.