With Guava you can do this in one line:
int[] array = Ints.toArray(Lists.newArrayList(Ints.stringConverter().convertAll(Splitter.on(",").split("1,2,3,4,5"))));
or so (if you don't require an array):
Iterable ints = Ints.stringConverter().convertAll(Splitter.on(",").split("1,2,3,4,5"));