title: Most efficient way to convert java.lang.Long to primitive int
body: <p>I have a weird scenario where I need to convert several million <code>java.lang.Long</code>s into primitive <code>int</code> types. I need to do this several times a day, every single day. Normally, I wouldn't worry about this kind of simple casting, but since it's happening so much, so often, I have to ask: what's the most efficient way to do this, and why?</p>
  
  <p>My first attempt:</p>
  
  <pre><code>Long myLong = getLong();
  int x = Integer.valueOf(myLong.toString())
  </code></pre>
  
  <p>Although this seems like going 3 sides around the barn. Thanks in advance.</p>