零 0 Java的Process对象 在执行命令之后一段时间再去获取InputStream

0 0 Java的Process对象 在执行命令之后一段时间再去获取InputStreamProcess pr Runtime.getRuntime().ex

0 0 Java的Process对象 在执行命令之后一段时间再去获取InputStream
    Process pr = Runtime.getRuntime().exec(finalCommand);
      BufferedReader br_in = null;
      try {
        br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
        String buff = null;
        while ( (buff = br_in.readLine()) != null) {
          System.out.println("stdout: " + buff);
          try {
            Thread.sleep(100);
          }
          catch (Exception e) {}
        }
        br_in.close();
      }
      catch (IOException ioe) {
        System.out.println("Error printing process output.");
        ioe.printStackTrace();
      }
      finally {
        try {
          br_in.close();
        }
        catch (Exception ex) {}
      }