|
@@ -3,7 +3,6 @@ package com.gyee.ygys.protocol;
|
|
import com.gyee.ygys.utils.BytesUtil;
|
|
import com.gyee.ygys.utils.BytesUtil;
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
|
|
|
-import java.io.ByteArrayOutputStream;
|
|
|
|
import java.util.BitSet;
|
|
import java.util.BitSet;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -28,9 +27,10 @@ public class BitMapGroup {
|
|
byte[] result = new byte[len];
|
|
byte[] result = new byte[len];
|
|
int offset = 0;
|
|
int offset = 0;
|
|
|
|
|
|
-// byte[] giBytes = BytesUtil.short2Byte(groupId);
|
|
|
|
-// System.arraycopy(giBytes,0,result,offset,2);
|
|
|
|
-// offset += 2;
|
|
|
|
|
|
+ byte[] giBytes = BytesUtil.short2Byte(groupIndex);
|
|
|
|
+ System.arraycopy(giBytes,0,result,offset,2);
|
|
|
|
+ offset += 2;
|
|
|
|
+
|
|
|
|
|
|
byte[] glBytes = BytesUtil.int2Byte(groupLength);
|
|
byte[] glBytes = BytesUtil.int2Byte(groupLength);
|
|
System.arraycopy(glBytes,0, result, offset, 4);
|
|
System.arraycopy(glBytes,0, result, offset, 4);
|
|
@@ -39,8 +39,8 @@ public class BitMapGroup {
|
|
byte[] bmlBytes = BytesUtil.int2Byte(bitMapLength);
|
|
byte[] bmlBytes = BytesUtil.int2Byte(bitMapLength);
|
|
System.arraycopy(bmlBytes,0,result,offset,4);
|
|
System.arraycopy(bmlBytes,0,result,offset,4);
|
|
offset += 4;
|
|
offset += 4;
|
|
-
|
|
|
|
- System.arraycopy(bitMapL2.toByteArray(), 0, result, offset, bitMapLength);
|
|
|
|
|
|
+ byte[] bytes = BytesUtil.bitSet2ByteArray(bitMapL2);
|
|
|
|
+ System.arraycopy(BytesUtil.bitSet2ByteArray(bitMapL2), 0, result, offset, bitMapLength);
|
|
offset += bitMapLength;
|
|
offset += bitMapLength;
|
|
|
|
|
|
System.arraycopy(data, 0, result, offset, data.length);
|
|
System.arraycopy(data, 0, result, offset, data.length);
|