public static byte[] parseBlobStringToByteArray(String input) throws IllegalArgumentException {
    try {
      BinaryLiteral binaryLiteral = new BinaryLiteral(input);
      return binaryLiteral.getValues();
    } catch (SemanticException e) {
      throw new IllegalArgumentException(e.getMessage());
    }
  }
Converts a string into a byte array based on the encoding format (hex or escape).

@param input The input string.
@return The encoded byte array.
@throws IllegalArgumentException if input is invalid.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/CommonUtils.java