This seems to be semantically identical to this question: http://www.javaprogrammingforums.com/java-theory-questions/6900-splitting-array.html