| 249 | } |
| 250 | |
| 251 | int BaseSequenceScanner::FindSyncBlock(const uint8_t* buffer, int buffer_len, |
| 252 | const uint8_t* sync, int sync_len) { |
| 253 | char* sync_str = reinterpret_cast<char*>(const_cast<uint8_t*>(sync)); |
| 254 | StringValue needle = StringValue(sync_str, sync_len); |
| 255 | |
| 256 | StringValue haystack( |
| 257 | const_cast<char*>(reinterpret_cast<const char*>(buffer)), buffer_len); |
| 258 | |
| 259 | StringSearch search(&needle); |
| 260 | int offset = search.Search(&haystack); |
| 261 | |
| 262 | if (offset != -1) { |
| 263 | // Advance offset past sync |
| 264 | offset += sync_len; |
| 265 | } |
| 266 | return offset; |
| 267 | } |
| 268 | |
| 269 | Status BaseSequenceScanner::SkipToSync(const uint8_t* sync, int sync_size) { |
| 270 | // offset into current buffer of end of sync (once found, -1 until then) |
nothing calls this directly
no test coverage detected