()
| 153 | } |
| 154 | |
| 155 | public readUTF8String(): string { |
| 156 | if (this._position >= this.length) throw new Error(ErrorMessage.PAGDecodeError); |
| 157 | let encoded = ''; |
| 158 | let dataLength = 0; |
| 159 | for (let i = this._position; i < this.length; i++) { |
| 160 | if (this.dataView.getUint8(i) === 0) { |
| 161 | break; |
| 162 | } |
| 163 | encoded += `%${this.dataView.getUint8(i).toString(16)}`; |
| 164 | dataLength += 1; |
| 165 | } |
| 166 | this._position += dataLength; |
| 167 | this.positonChanged(); |
| 168 | return decodeURIComponent(encoded); |
| 169 | } |
| 170 | |
| 171 | public readEncodedUint32(): number { |
| 172 | const valueMask = 127; |
no test coverage detected