| 143 | } |
| 144 | |
| 145 | std::string ByteArray::readUTF8String() { |
| 146 | if (_position < dataView.size()) { |
| 147 | auto text = reinterpret_cast<const char*>(dataView.bytes() + _position); |
| 148 | auto maxLength = dataView.size() - _position; |
| 149 | auto textLength = strnlen(text, maxLength); |
| 150 | textLength = std::min(textLength, maxLength); |
| 151 | positionChanged(textLength); |
| 152 | return {text, textLength}; |
| 153 | } |
| 154 | LOGI("End of file was encountered."); |
| 155 | return ""; |
| 156 | } |
| 157 | |
| 158 | void ByteArray::bitPositionChanged(size_t offset) { |
| 159 | _bitPosition += offset; |
no test coverage detected