title: How to efficiently get short array from resources on Android?
body: <p>I've got an XML file storing an array of shorts in my resources. I need to assign this array, but Android API only provides a way to get array of ints (<code>getResources.getIntArray()</code>). I've ended up getting an array of ints and converting it to array of shorts later, but that's hardly ideal.</p>
  
  <p>Is there a way to get an array of shorts from Android resources? If not, is there a more efficient/cleaner way of converting int array into short array? My code currently looks like this:</p>
  
  <pre><code>int indicesInt[] = context.getResources().getIntArray(R.array.indices);
  short indices[] = new short[indicesInt.length];
  for (int i = 0; i &lt; indicesInt.length; i++) {
      indices[i] = (short)indicesInt[i];
  }
  </code></pre>