Skip to content

VariableLengthInt does not set bit 7 when parsing inputStream #35

@Daniel63656

Description

@Daniel63656

I noticed that VariableLengthInts do not set the 7th bit on any byte in the parseBytes() function. This can be fixed easily by droping the & operation in line 78 resulting in
ints[mSizeInBytes - 1] = b;

To account this change line 93 must be changed to ensure mValue is correctly calculated
mValue += (ints[i] & 0x7F) << shift;

And by the way why don't you set shift (line83-86) simply by
int shift = (mSizeInBytes-1)*7;
saves another for loop ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions