|
|
@ -10,10 +10,10 @@ function read(buf, offset) {
|
|
|
|
, counter = offset
|
|
|
|
, counter = offset
|
|
|
|
, b
|
|
|
|
, b
|
|
|
|
, l = buf.length
|
|
|
|
, l = buf.length
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
if(counter >= l) {
|
|
|
|
if(counter >= l) {
|
|
|
|
read.bytesRead = 0
|
|
|
|
read.bytes = 0
|
|
|
|
return undefined
|
|
|
|
return undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
b = buf[counter++]
|
|
|
|
b = buf[counter++]
|
|
|
@ -22,8 +22,8 @@ function read(buf, offset) {
|
|
|
|
: (b & REST) * Math.pow(2, shift)
|
|
|
|
: (b & REST) * Math.pow(2, shift)
|
|
|
|
shift += 7
|
|
|
|
shift += 7
|
|
|
|
} while (b >= MSB)
|
|
|
|
} while (b >= MSB)
|
|
|
|
|
|
|
|
|
|
|
|
read.bytes = counter - offset
|
|
|
|
read.bytes = counter - offset
|
|
|
|
|
|
|
|
|
|
|
|
return res
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
}
|
|
|
|