From here:
_shl: function (a, b){
for (++b; --b; a = ((a %= 0x7fffffff + 1) & 0x40000000) == 0x40000000 ? a * 2 : (a - 0x40000000) * 2 + 0x7fffff
_readByte(i, size)
: size
is the buffer length in byte, i
is the reversed index (index from the end of the buffer, not from the start) of the byte which you want to read._readBits(start, length, size)
: size
is the buffer length in byte, length
is the number of bits which you want to read, start
is the the index of the first bit which you want to read._shl(a, b)
: convert read byte a
to actual value based on its index b
.Because _readByte
use reversed index, so lastByte
less than curByte
.
offsetLeft
and offsetRight
are used to remove unrelated bits (bits not in read range) from lastByte
and curByte
respectively.