Esempio n. 1
0
        /// <summary>
        /// Counts and returns number of lines in a file </summary>
        /// <returns> number of lines in a file </returns>
        /// <exception cref="FileNotFoundException">  </exception>
        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: private long countFileLines() throws java.io.FileNotFoundException
        private long countFileLines()
        {
            LineNumberReader lnr = new LineNumberReader(new FileReader(file));

            try {
                //  lnr.skip(Long.MAX_VALUE);
                while (lnr.skip(long.MaxValue) > 0)
                {
                }
                ;
            } catch (IOException ex) {
            }
            return(lnr.getLineNumber() + 1);
        }