title: Fast way to convert a byte[] string to its Integer value
body: <p>I am reading a large file from disk. That file just contains numbers, encoded as plain old ASCII. At the moment, I am reading in chunks, and then doing something like this:</p>
  
  <pre><code>byte[] token;  // bytes representing a bunch of numbers
  int n = Integer.parseInt(new String(token));
  </code></pre>
  
  <p>In other words, I am converting to a String and then parsing the String to Integer. I would like to know if there is a way to use fast operations like shifting and binary arithmetic instead?</p>
  
  <p>I suspect that this could be made faster. For example, the raw bytes for the numbers 1,2,3 are 49,50,51. Any ideas for hacks?</p>