title: Count of digits from char array varies with same input in Java
body: <p>I need to load big amount of digits from console, separated with whitespaces and my result should count number of digits within the input. These can be all numbers from 0 to 10^9.</p>
  
  <p>Code below works for smaller input, but for data like in file <a href="https://ufile.io/572be" rel="nofollow noreferrer">here</a> it shows wrong result, what's more it is different with every execution (for attached file it should be 968364).</p>
  
  <p>What am I doing wrong? I can't use any methods or classes within the loop, it has to work on primitive types, but apparently I'm missing something.</p>
  
  <p>Please help, thanks in advance for any tips.</p>
  
  <pre><code>int input_size = 0;
          char[] input = new char[1000000];
              InputStreamReader in = new InputStreamReader(System.in);
              in.read(input);
              for(int a = 0; a&lt;input.length; a++){
                  if (input[a] &gt;= 48 &amp;&amp; input[a] &lt;= 57){
                      input_size ++;
                  }
              }
              System.out.println(input_size);
  </code></pre>