* @return
* @throws Exception
*/
public byte[] toBytes(boolean rights, byte [] desKey) throws Exception{
int startIndex = 0;
SerializeBase serialize = SerializeBase.getInstance(this.getSerializeType());
CompressBase compress = CompressBase.getInstance(this.getCompressType());
this.sdpType = SDPType.getSDPType(this.sdpEntity);
byte[] sdpData = serialize.serialize(this.sdpEntity);
//数据加密
if(this.getSDPType().getNum() != 5 && rights && desKey != null){
sdpData = DESCoderHelper.getInstance().encrypt(sdpData, desKey);//DES加密数据
}