public byte[] ToBytes() //返回当前对象的字节数组印象 { byte[] reVal = new Byte[CMPP_MSG_Header.HeaderLength + this.BodyLength]; header.toBytes().CopyTo(reVal, 0); //消息头 getSourceAdd().CopyTo(reVal, CMPP_MSG_Header.HeaderLength); //源地址 企业代码 getMd5Code().CopyTo(reVal, CMPP_MSG_Header.HeaderLength + 6); //认证md5 reVal[CMPP_MSG_Header.HeaderLength + 6 + 16] = this.ver; //版本字节 BIConvert.Int2Bytes(Convert.ToUInt32(this._timestamp)).CopyTo(reVal, CMPP_MSG_Header.HeaderLength + 6 + 16 + 1); return(reVal); }
public CMPP_MSG_Header(CMPP_COMMAND_ID Command_ID) //发送前 { BIConvert.Int2Bytes((uint)Command_ID).CopyTo(initValue, 4); }