Пример #1
0
 @Override
 protected byte[] bodytoBytes() {
   byte[] data = new byte[5];
   try {
     int offset = 0;
     data[0] = result;
     offset += 1;
     System.arraycopy(DataTypeUtil.toByteArray32Long(verifycode), 0, data, offset, 4);
     offset += 4;
   } catch (Exception e) {
     LogUtil.getLogger().error("登录应答消息toBytes转换异常", e);
     e.printStackTrace();
   }
   return data;
 }
Пример #2
0
 @Override
 protected boolean bodyfromBytes(byte[] b) {
   boolean resultState = false;
   int offset = 0;
   try {
     result = b[0];
     offset += 1;
     verifycode = Converter.bigBytes2Unsigned32Long(b, offset);
     offset += 4;
     resultState = true;
   } catch (Exception e) {
     LogUtil.getLogger().error("登录应答消息fromBytes转换异常", e);
     e.printStackTrace();
   }
   return resultState;
 }