diff --git a/jsowell-common/src/main/java/com/jsowell/common/core/domain/ykc/YKCDataProtocol.java b/jsowell-common/src/main/java/com/jsowell/common/core/domain/ykc/YKCDataProtocol.java index 67de4b837..861c2c229 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/core/domain/ykc/YKCDataProtocol.java +++ b/jsowell-common/src/main/java/com/jsowell/common/core/domain/ykc/YKCDataProtocol.java @@ -61,13 +61,20 @@ public class YKCDataProtocol { this.crcByte = new byte[]{msg[msg.length - 2], msg[msg.length - 1]}; } + /** + * 获取字节数组 + */ + public byte[] getBytes() { + return Bytes.concat(this.head, this.length, this.serialNumber, this.encryptFlag, this.frameType, this.msgBody, this.crcByte); + } + /** * 转换为十六进制字符串 * * @return 报文 */ public String getHEXString() { - byte[] bytes = Bytes.concat(this.head, this.length, this.serialNumber, this.encryptFlag, this.frameType, this.msgBody, this.crcByte); + byte[] bytes = getBytes(); return BytesUtil.binary(bytes, 16); } }