Correctly handle reading 0 bits

This commit is contained in:
Oliver Woodman 2017-07-31 21:28:22 +01:00
parent 85445536c3
commit 9c2528a70f

View File

@ -155,6 +155,9 @@ public final class ParsableBitArray {
* @return An integer whose bottom n bits hold the read data.
*/
public int readBits(int numBits) {
if (numBits == 0) {
return 0;
}
int returnValue = 0;
bitOffset += numBits;
while (bitOffset > 8) {