code: public int toInt(int defaultValue) {
  		try {
  			return Integer.parseInt(sb.toString());
  		} catch (java.lang.NumberFormatException e) {
  			e.printStackTrace();
  		}
  		return defaultValue;
  	}
docs: returns int value ,when format error occurred ,returns default value
  
  @param defaultValue
  @return