java BufferedReader max lines
<pre><code>BufferedReader in = new BufferedReader(new FileReader(file));
String line;

int i = 0;
while((line = in.readLine()) != null){
    if(line.contains("Time:") == true){
        System.out.println(line);
    }
    i++;
}
System.out.println(i);
in.close();
</code></pre>

<p>This code reads file in which is <strong>6213238</strong> lines, but it only reads <strong>1244178</strong>. Is there any  limits of lines that this class can read or is it with memory usage ? And how to make it work </p>

<p><strong>Edit:</strong></p>

<p>I have print last 18 lines like </p>

<pre><code>while((line = in.readLine()) != null){
            if(line.contains("Time:") == true){
                System.out.println(line);
            }
            if(i &gt; 1244160)
            {
                System.out.println(line);
            }
            i++;
        }
</code></pre>

<p>And it showed me 18 last lines from file. I have to say that its strange</p>

<p><strong>EDIT</strong>
Problem was with file encoding when I changed <strong>UTF-16</strong> to <strong>UTF-8</strong>, I recive all lines from file</p>
