()
| 195 | } |
| 196 | |
| 197 | public readEncodedUint64(): number { |
| 198 | const valueMask = 127; |
| 199 | const hasNext = 128; |
| 200 | let value = 0; |
| 201 | let byte = 0; |
| 202 | for (let i = 0; i < 64; i += 7) { |
| 203 | if (this._position >= this.length) { |
| 204 | throw Error('readEncodedUint64 End of file was encountered.'); |
| 205 | } |
| 206 | byte = this.dataView.getUint8(this._position); |
| 207 | this._position += 1; |
| 208 | value |= (byte & valueMask) << i; |
| 209 | if ((byte & hasNext) === 0) { |
| 210 | break; |
| 211 | } |
| 212 | } |
| 213 | this.positonChanged(); |
| 214 | return value; |
| 215 | } |
| 216 | |
| 217 | public readEncodeInt64(): number { |
| 218 | const data = this.readEncodedUint64(); |
no test coverage detected