some refactoring and bugfixes

This commit is contained in:
Ziver Koc 2016-02-02 17:06:06 +01:00
parent 4d31e66ebd
commit 63f191db4c
4 changed files with 56 additions and 17 deletions

View file

@ -57,7 +57,7 @@ public class BinaryStructParser {
int readLength = 0;
byte[] valueData = new byte[(int) Math.ceil(length / 8.0)];
for (int index = 0; index < valueData.length; ++index) {
valueData[index] = ByteUtil.getBits(data[byteIndex], bitIndex, bitLength);
valueData[index] = ByteUtil.getShiftedBits(data[byteIndex], bitIndex, bitLength);
readLength += bitLength;
byteIndex++;
bitIndex = 7;