List of utility methods to do Hex to Byte
byte | convertHexCharacterToHalfByte(char character) convert Hex Character To Half Byte if ((character >= '0') && (character <= '9')) { return (byte) (character - '0'); } else if ((character >= 'a') && (character <= 'f')) { return (byte) (character - 'a' + 10); } else if ((character >= 'A') && (character <= 'F')) { return (byte) (character - 'A' + 10); } else { throw new IllegalArgumentException("'" + character + "' is an illegal character in HEX code!"); ... |
byte | convertHexDigit(byte b) convert Hex Digit if ((b >= '0') && (b <= '9')) return (byte) (b - '0'); if ((b >= 'a') && (b <= 'f')) return (byte) (b - 'a' + 10); if ((b >= 'A') && (b <= 'F')) return (byte) (b - 'A' + 10); throw new IllegalArgumentException("!hex:" + Integer.toHexString(0xff & b)); |
byte | convertHexDigit(byte b) convert Hex Digit if ((b >= '0') && (b <= '9')) { return (byte) (b - '0'); if ((b >= 'a') && (b <= 'f')) { return (byte) (b - 'a' + 10); if ((b >= 'A') && (b <= 'F')) { return (byte) (b - 'A' + 10); ... |
byte | convertHexDigit(byte b) Convert a byte character value to hexadecimal digit value. if ((b >= '0') && (b <= '9')) return (byte) (b - '0'); if ((b >= 'a') && (b <= 'f')) return (byte) (b - 'a' + 10); if ((b >= 'A') && (b <= 'F')) return (byte) (b - 'A' + 10); throw new IllegalArgumentException("requestUtil.convertHexDigit.notHex" + Character.valueOf((char) b)); |
byte | convertHexDigit(byte b) convert Hex Digit if ((b >= '0') && (b <= '9')) return (byte) (b - '0'); if ((b >= 'a') && (b <= 'f')) return (byte) (b - 'a' + 10); if ((b >= 'A') && (b <= 'F')) return (byte) (b - 'A' + 10); return 0; |
byte | convertHexDigit(byte c) convert Hex Digit byte b = (byte) ((c & 0x1f) + ((c >> 6) * 0x19) - 0x10); if (b < 0 || b > 15) throw new NumberFormatException("!hex " + c); return b; |