public Long resolve() throws IOException {
		if (resolved) {
			throw new IOException("Value already resolved");
		}
		resolved = true;
		
		boolean negative = false;
		long value = 0;
		
		int b = 0;
		while ((b = is.read()) >= 0) {
			int digit = b - '0';
			
			if (digit < 0 || digit > 9) {
				if (b == '-') {
					negative = true;
				} else if (b == 'e') {
					break;
				} else {
					throw new IOException("Unexpected character in integer value: " + Character.forDigit(b, 10));
				}
			} else {
				value = (value * 10) + digit;
			}
		}
		
		if (negative) {
			value *= -1;
		}
		
		return value;
	}