作者:naozhewaner_254 | 来源:互联网 | 2023-09-24 20:22
publicclassStringUtil{publicstaticStringstr696d706e7274;publicstaticvoidmain(String[
public class StringUtil {
public static String str = "696d706f7274";
public static void main(String[] args) {
System.out.println(new String(getBytes(str)));
}
public static boolean isOdd(String str) {
int length = str.length();
int isOdd = length % 2;
if (isOdd == 0)
return false;
else
return true;
}
public static byte[] getBytes(String str) {
boolean isOdd = isOdd(str);
int size = str.length();
if (isOdd) {
byte[] byteOdd = new byte[size / 2 + 1];
for (int j = 0, i = 0; i
16进制转换字节数组工具类,,
16进制转换字节数组工具类