package com.dfkj.util;
import java.util.ArrayList;
import java.util.List;
public class BB {
public static void main(String[] args) {
//已 -1,-1,-1,-1,-1 j进行分割
byte [] bb=new byte[]{-1, -1, -1, -1, -1, 0, 0, 12, -1, -1, -1, -45, 96, -59, 0, 19, -112, 19, -107,-1, -1, -1, -1, -1, 0, 0, 12, -1, -1, -1, -45, 96, -59, 0, 19, -112, 19, -107,-1, -1, -1, -1, -1, 0, 0, 12, -1, -1, -1, -45, 96, -59, 0, 19, -112, 19, -109};
List<byte[]> byteList=new ArrayList<byte[]>();
int end=bb.length;//
for(int i=bb.length-1;i>0;i--){
//正常情况
if((bb[i-1]==-1&&bb[i-2]==-1&&bb[i-3]==-1&&bb[i-4]==-1&&bb[i-5]==-1)||(i-5<15)){
//正常情况
int size=end-(i-5);
byte[] onebyte;
//当减到最后,长度不够了,直接到头
if(i-5<15){
onebyte=new byte[end];
System.arraycopy(bb, 0, onebyte, 0, end);
byteList.add(onebyte);
return ;
}
onebyte=new byte[end-(i-5)];
System.arraycopy(bb, i-5, onebyte, 0, size);
end=i-5;
byteList.add(onebyte);
}
}
for (byte[] bs : byteList) {
for (int i = 0; i < bs.length; i++) {
System.out.println(bs[i]);
}
}
}
}