标签: java
我有一些字符串,我将从UI收到:
String str = "12a47b4cea";
表示十六进制数的序列。 如何将其转换为字节数组?
预期输出为:
byte[] arr = new byte[] {0x12, 0xa4, 0x7b, 0x4c, 0xea };