public int intValueFromHex() throws NumberFormatException {
        if (m_endPos == 0) {
            throw new NumberFormatException("iEndPos == 0");
        }
        int result = 0;
        int digit;
        boolean negative = false;
        int j = m_startPos;
        if (m_buffer[j] == '-') {
            negative = true;
            j++;
        }
        for(;j !=m_endPos; j++) {
            digit = Character.digit(m_buffer[j], 16);
            if (digit < 0) {
                throw new NumberFormatException(this.toString());
            }
            if (result == 0) {
                result = digit;
            } else {
                result <<= 4; //r*16
                result += digit; //r*16 + digit
            }
        }
        if (negative) {
            result = -result;
        }
        return result;
    }