code: public static int getNumberOfLines(Reader in) throws IOException {
      LineNumberReader lnr = new LineNumberReader(in);
      lnr.skip(Long.MAX_VALUE);
      in.close();
      return lnr.getLineNumber();
    }
docs: Computes the number of files in the input Reader.
  
  @param in
  the reader.
  @return the number of lines.
  @throws IOException