|
@@ -21,13 +21,14 @@ public class BitMapMessageParser {
|
|
|
|
|
|
BitMapGroup bmg = new BitMapGroup();
|
|
|
int offset = 0;
|
|
|
-// bmg.setGroupId(BytesUtil.getShort(array, offset));
|
|
|
-// offset += 2;
|
|
|
-
|
|
|
- bmg.setGroupLength(BytesUtil.getInt32(array,offset));
|
|
|
+ bmg.setGroupIndex(BytesUtil.getShort(array, offset));
|
|
|
+ offset += 2;
|
|
|
+ byte[] tempByte = new byte[4];
|
|
|
+ System.arraycopy(array,offset,tempByte,0,4);
|
|
|
+ bmg.setGroupLength(BytesUtil.byte2Int(tempByte));
|
|
|
offset += 4;
|
|
|
-
|
|
|
- bmg.setBitMapLength(BytesUtil.getInt32(array, offset));
|
|
|
+ System.arraycopy(array,offset,tempByte,0,4);
|
|
|
+ bmg.setBitMapLength(BytesUtil.byte2Int(tempByte));
|
|
|
offset += 4;
|
|
|
|
|
|
bmg.setBitMapL2(BytesUtil.getBitSet(array,offset, bmg.getBitMapLength()));
|
|
@@ -71,7 +72,10 @@ public class BitMapMessageParser {
|
|
|
offset += 1; //越过保留位
|
|
|
ArrayList<BitMapGroup> groups = new ArrayList<>();
|
|
|
while(offset < array.length-3) {
|
|
|
- int groupLength = BytesUtil.getInt32(array,offset);
|
|
|
+ //int groupLength = BytesUtil.getInt32(array,offset+2);
|
|
|
+ byte[] groupLengthByte = new byte[4];
|
|
|
+ System.arraycopy(array,offset+2,groupLengthByte,0,4);
|
|
|
+ int groupLength = BytesUtil.byte2Int(groupLengthByte);
|
|
|
byte[] groupBytes = BytesUtil.getSubBytes(array, offset, groupLength);
|
|
|
BitMapGroup bmg = parserBitMapGroup(groupBytes);
|
|
|
groups.add(bmg);
|