()
| 169 | } |
| 170 | |
| 171 | public readEncodedUint32(): number { |
| 172 | const valueMask = 127; |
| 173 | const hasNext = 128; |
| 174 | let value = 0; |
| 175 | let byte = 0; |
| 176 | for (let i = 0; i < 32; i += 7) { |
| 177 | if (this._position >= this.length) { |
| 178 | throw Error('readEncodedUint32 End of file was encountered.'); |
| 179 | } |
| 180 | byte = this.dataView.getUint8(this._position); |
| 181 | this._position += 1; |
| 182 | value |= (byte & valueMask) << i; |
| 183 | if ((byte & hasNext) === 0) { |
| 184 | break; |
| 185 | } |
| 186 | } |
| 187 | this.positonChanged(); |
| 188 | return value; |
| 189 | } |
| 190 | |
| 191 | public readEncodeInt32(): number { |
| 192 | const data = this.readEncodedUint32(); |
no test coverage detected