public String[] readAllLines(){
  ArrayList<String> lines=new ArrayList<String>();
  while (hasNextLine()) {
    lines.add(readLine());
  }
  return lines.toArray(new String[0]);
}

public String [ ] readAllLines ( ) { ArrayList < String > lines = new ArrayList < String > ( ) ; while ( hasNextLine ( ) ) { lines . add ( readLine ( ) ) ; } return lines . toArray ( new String [ 0 ] ) ; }
reads all remaining lines from this input stream and returns them as an array of strings .
