[java] Convert an integer to an array of digits