|
@@ -222,33 +222,4 @@ public class ReceiveClearData {
|
|
|
save(monitorDataEntity);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 16进制转换成为string类型字符串
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- */
|
|
|
- public static String hexStringToString(String s) {
|
|
|
- if (s == null || s.equals("")) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- s = s.replace(" ", "");
|
|
|
- byte[] baKeyword = new byte[s.length() / 2];
|
|
|
- for (int i = 0; i < baKeyword.length; i++) {
|
|
|
- try {
|
|
|
- baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16));
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- try {
|
|
|
- s = new String(baKeyword, "UTF-8");
|
|
|
- new String();
|
|
|
- } catch (Exception e1) {
|
|
|
- e1.printStackTrace();
|
|
|
- }
|
|
|
- return s;
|
|
|
- }
|
|
|
- public static void main(String[] args) {
|
|
|
- System.out.println(ReceiveClearData.hexStringToString("ABCD0031EA892108220200010501FE0F7710443131333B322E313B352E302031392020202020000000FFFF58521704013EAEEAF02B0D0A"));
|
|
|
- }
|
|
|
}
|