private static void err(Throwable e) {
    System.err.println("error: " + e.getMessage());
    System.err.println("-- StackTrace --");
    System.err.println(Throwables.getStackTraceAsString(e));
  }
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