| 151 | } |
| 152 | |
| 153 | std::string DecodeStream::readUTF8String() { |
| 154 | if (_position < dataView.size()) { |
| 155 | auto text = reinterpret_cast<const char*>(dataView.bytes() + _position); |
| 156 | auto maxLength = dataView.size() - _position; |
| 157 | auto textLength = strnlen(text, maxLength); |
| 158 | if (textLength < maxLength) { |
| 159 | positionChanged(textLength + 1); |
| 160 | return {text, textLength}; |
| 161 | } |
| 162 | } |
| 163 | PAGThrowError(context, "End of file was encountered."); |
| 164 | return ""; |
| 165 | } |
| 166 | |
| 167 | int32_t DecodeStream::readEncodedInt32() { |
| 168 | auto data = readEncodedUint32(); |
no test coverage detected