*
L
2026-04-22 77e54aec65693683bc2b9ac50e08df6a06c53493
src/main/java/com/zy/common/utils/Struct.java
@@ -244,7 +244,7 @@
   
   @SuppressWarnings({ "unchecked", "rawtypes" })
   public static <T extends Struct> T decode(Class<? extends Struct> cls,byte[] bytes) throws Exception{
      Struct instance = cls.newInstance();
      Struct instance = cls.getDeclaredConstructor().newInstance();
      return instance.decode(bytes);
   }
@@ -370,6 +370,8 @@
      instance.unusedBytes = unusedBytes;
      return (T) instance;
   }
   // 字节数组 ===>> 转为十六进制字符串
   public static String toHex(byte[] bytes) {
        StringBuilder buf = new StringBuilder(bytes.length * 2);
        for(byte b : bytes) { // 使用String的format方法进行转换
@@ -444,7 +446,6 @@
      }
      return bbt;
   }
    
    public static class TestMessage {
      public @size(1) byte begin = 0x7e;//起始符