code: public void print(int i)
    {
      if (i == 0x80000000) {
        print("-2147483648");
        return;
      }
  
      if (i < 0) {
        write('-');
        i = -i;
      } else if (i < 9) {
        write('0' + i);
        return;
      }
  
      int length = 0;
      int exp = 10;
  
      if (i >= 1000000000)
        length = 9;
      else {
        for (; i >= exp; length++)
          exp = 10 * exp;
      }
  
      int j = 31;
      
      while (i > 0) {
        _tempCharBuffer[--j] = (char) ((i % 10) + '0');
        i /= 10;
      }
  
      write(_tempCharBuffer, j, 31 - j);
    }
docs: Prints an integer value.