package org.ts.ddcs.DataItemTemplate;


import org.ts.ddcs.Log.LogHelper;
import org.ts.ddcs.Tool.BytesHelp;

/**
 * FD
 * 流速批量数据传输
 */
@SuppressWarnings("all")
public class DataItemTemplateDATA  extends DataItemTemplate{
    @Override
    public byte[] Stream(byte[] data) {
        byte[] remain = data;
        if(this.macth){
            return remain;
        }
        String flag = BytesHelp.byte2HexStr(remain,0,1);
        if(flag.equals(this.feture)){
            int dataTotalLen = data.length-2;
            this.varcharValue = BytesHelp.byte2HexStr(BytesHelp.subBytes(remain, 0, dataTotalLen-2));
            LogHelper.info(this.desc+":"+this.feture+":"+this.varcharValue);
            remain =  new byte[0];
            this.macth=true;
        }
        return remain;
    }
}
