public final static void itos(int i, int index, char[] buf) {
		assert (!(i == Integer.MIN_VALUE));

		int q, r;
		char sign = 0;

		if (i < 0) {
			sign = '-';
			i = -i;
		}

		// Generate two digits per iteration
		while (i >= 65536) {
			q = i / 100;
			// really: r = i - (q * 100);
			r = i - ((q << 6) + (q << 5) + (q << 2));
			i = q;
			buf[--index] = DigitOnes[r];
			buf[--index] = DigitTens[r];
		}

		// Fall thru to fast mode for smaller numbers
		// assert(i <= 65536, i);
		for (;;) {
			q = (i * 52429) >>> (16 + 3);
			r = i - ((q << 3) + (q << 1)); // r = i-(q*10) ...
			buf[--index] = digits[r];
			i = q;
			if (i == 0)
				break;
		}
		if (sign != 0) {
			buf[--index] = sign;
		}
	}
public final static void itos ( int i , int index , char [ ] buf ) { assert ( ! ( i == Integer . MIN_VALUE ) ) ; int q , r ; char sign = 0 ; if ( i < 0 ) { sign = '-' ; i = - i ; } while ( i >= 65536 ) { q = i / 100 ; r = i - ( ( q << 6 ) + ( q << 5 ) + ( q << 2 ) ) ; i = q ; buf [ -- index ] = DigitOnes [ r ] ; buf [ -- index ] = DigitTens [ r ] ; } for ( ; ; ) { q = ( i * 52429 ) > > > ( 16 + 3 ) ; r = i - ( ( q << 3 ) + ( q << 1 ) ) ; buf [ -- index ] = digits [ r ] ; i = q ; if ( i == 0 ) break ; } if ( sign != 0 ) { buf [ -- index ] = sign ; } }
Places characters representing the integer i into the character array
buf. The characters are placed into the buffer backwards starting with
the least significant digit at the specified index (exclusive), and
working backwards from there.

Will fail if i == Integer.MIN_VALUE

@param i
integer
@param index
index
@param buf
character buffer