private static void consumeAllInput(Process p) throws IOException {
  InputStream in=null;
  try {
    in=new BufferedInputStream(p.getInputStream());
    byte[] buf=new byte[1024];
    while (in.read(buf,0,buf.length) >= 0)     ;
  }
  finally {
    try {
      if (in != null) {
        in.close();
      }
    }
 catch (    IOException ignored) {
    }
  }
}

private static void consumeAllInput ( Process p ) throws IOException { InputStream in = null ; try { in = new BufferedInputStream ( p . getInputStream ( ) ) ; byte [ ] buf = new byte [ 1024 ] ; while ( in . read ( buf , 0 , buf . length ) >= 0 ) ; } finally { try { if ( in != null ) { in . close ( ) ; } } catch ( IOException ignored ) { } } }
consumes all input from a process . see also processbuilder . redirecterrorstream ( )
