code: public final static void itosReverse(long i, int index, char[] buf) {
  		assert (i >= 0);
  		long q;
  		int r;
  
  		// Get 2 digits/iteration using longs until quotient fits into an int
  		while (i > Integer.MAX_VALUE) {
  			q = i / 100;
  			// really: r = i - (q * 100);
  			r = (int) (i - ((q << 6) + (q << 5) + (q << 2)));
  			i = q;
  			buf[index++] = DigitOnes[r];
  			buf[index++] = DigitTens[r];
  		}
  
  		// Get 2 digits/iteration using ints
  		int q2;
  		int i2 = (int) i;
  		while (i2 >= 65536) {
  			q2 = i2 / 100;
  			// really: r = i2 - (q * 100);
  			r = i2 - ((q2 << 6) + (q2 << 5) + (q2 << 2));
  			i2 = q2;
  			buf[index++] = DigitOnes[r];
  			buf[index++] = DigitTens[r];
  		}
  
  		// Fall thru to fast mode for smaller numbers
  		// assert(i2 <= 65536, i2);
  		for (;;) {
  			q2 = (i2 * 52429) >>> (16 + 3);
  			r = i2 - ((q2 << 3) + (q2 << 1)); // r = i2-(q2*10) ...
  			buf[index++] = digits[r];
  			i2 = q2;
  			if (i2 == 0)
  				break;
  		}
  	}
docs: Places characters representing the integer i into the character array buf
  in reverse order.
  
  Will fail if i &lt; 0 (zero)
  
  @param i
  integer
  @param index
  index
  @param buf
  character buffer