code: public Number readNumber() throws IOException {
  		//there should be a character left from readNextToken!
  		if (currentCharacter < 0) {
  			throw new IllegalStateException("Missed first digit");
  		}
  		
  		//read sign
  		boolean negative = false;
  		if (currentCharacter == '-') {
  			negative = true;
  			currentCharacter = r.read();
  		}
  		
  		//try to real an integer first
  		long result = 0;
  		while (currentCharacter >= 0) {
  			if (currentCharacter >= '0' && currentCharacter <= '9') {
  				result = result * 10 + currentCharacter - '0';
  			} else if (currentCharacter == '.') {
  				//there is a dot. read real number
  				return readReal(result, negative);
  			} else {
  				break;
  			}
  			currentCharacter = r.read();
  		}
  		
  		return negative ? -result : result;
  	}
docs: Reads a number from the stream
  @return the number
  @throws IOException if the stream could not be read