package org.ts.ddcs.DataItemTemplate;

import org.ts.ddcs.log.LogHelper;
import org.ts.ddcs.Tool.BytesHelp;
import org.ts.ddcs.Tool.StringUtil;

import java.math.BigDecimal;

/**
 * f3
 * 图片数据
 */
@SuppressWarnings("all")
public class DataItemTemplatePIC 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));
            remain = new byte[0];
            this.macth = true;
        }
        return remain;
    }
}
