Guava's Ints.toArray() will do the conversion for you.