public void run() {
    try {
      InputStreamReader isr = new InputStreamReader(is);
      BufferedReader br = new BufferedReader(isr);
      while(true) {
        String line = br.readLine();
        if(line == null) {
          break;
        }        
        console.printLine(line);
      }
    } catch (IOException ioe) {
      ioe.printStackTrace();  
    }
 }
Read a stream from an external process
hplsql/src/main/java/org/apache/hive/hplsql/StreamGobbler.java