private static byte decodeHex()

in core/src/main/java/org/apache/calcite/avatica/util/ByteString.java [213:224]


  private static byte decodeHex(char c) {
    if (c >= '0' && c <= '9') {
      return (byte) (c - '0');
    }
    if (c >= 'a' && c <= 'f') {
      return (byte) (c - 'a' + 10);
    }
    if (c >= 'A' && c <= 'F') {
      return (byte) (c - 'A' + 10);
    }
    throw new IllegalArgumentException("invalid hex character: " + c);
  }