Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal int ReadInt32(int numBits)
- {
- if (numBits <= 0)
- return 0;
- int ret = 0;
- while (true)
- {
- if (ReadPos >= _numBits)
- {
- return ret;
- }
- int pos7 = (ReadPos & 7);
- int bitsLeftInByte = 8 - pos7;
- int subNum = bitsLeftInByte;
- if (bitsLeftInByte >= numBits)
- subNum = numBits;
- var lShift = (byte) (1 << subNum);
- int v10 = _buffer[ReadPos >> 3] >> (ReadPos & 7);
- numBits -= subNum;
- ret |= ((lShift - 1) & v10) << numBits;
- _readPos = ReadPos + subNum;
- if (numBits == 0)
- return ret;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment