public static void main(String[] args) {
/*
TLV 解析
*/
String tag = "30";
String code = "32 01 00 AE 90 02 00 01 02 30 03 00 AB 32 31 31 02 00 32 33 33 01 00 CC";
String[] codes = code.split(" ");
StringBuilder result = new StringBuilder();
for (int i = 0; i < codes.length; i++) {
if (tag.equals(codes[i]) && codes[i+1].startsWith("0")) {
int len = Integer.parseInt(codes[i+1]);
for (int j = 0; j < len; j++) {
result.append(codes[i+3+j]).append(" ");
}
}
}
System.out.println(result);
}
05-25
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交