Examples of SerializeBase


Examples of com.bj58.spat.gaea.protocol.serializer.SerializeBase

    return sdpEntity;
  }

  public byte[] toBytes() 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);
       
        sdpData = compress.zip(sdpData);
        int protocolLen = HEAD_STACK_LENGTH + sdpData.length;
        this.setTotalLen(protocolLen);
       
View Full Code Here

Examples of com.bj58.spat.gaea.protocol.serializer.SerializeBase

        byte[] sdpData = new byte[data.length - startIndex];
        System.arraycopy(data, startIndex, sdpData, 0, data.length - startIndex);
        sdpData = CompressBase.getInstance(ct).unzip(sdpData);
        p.setUserData(sdpData);
       
        SerializeBase serialize = SerializeBase.getInstance(st);
        p.setSdpEntity(serialize.deserialize(sdpData, SDPType.getSDPClass(p.getSDPType())));
        return p;
    }
View Full Code Here

Examples of com.bj58.spat.gaea.protocol.serializer.SerializeBase

        if(p.getSDPType().getNum() != 5 && rights && desKey !=null){
          sdpData = DESCoderHelper.getInstance().decrypt(sdpData, desKey);//DES解密数据
        }
       
        p.setUserData(sdpData);
        SerializeBase serialize = SerializeBase.getInstance(st);       
        p.setSdpEntity(serialize.deserialize(sdpData, SDPType.getSDPClass(p.getSDPType())));
        return p;
    }
View Full Code Here

Examples of com.bj58.spat.gaea.protocol.serializer.SerializeBase

     * @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加密数据
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.