private int countLines(Process process) throws IOException {
  logErrors(process);
  InputStream in=process.getInputStream();
  BufferedReader reader=new BufferedReader(new InputStreamReader(in));
  int count=0;
  while (reader.readLine() != null) {
    count++;
  }
  return count;
}

private int countLines ( Process process ) throws IOException { logErrors ( process ) ; InputStream in = process . getInputStream ( ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( in ) ) ; int count = 0 ; while ( reader . readLine ( ) != null ) { count ++ ; } return count ; }
counts lines of input from the given process . equivalent to " wc - l " .
