matchBytes(input, b1, ...)
which
).input
that match the start of the bytes
sequence (see example).buf <- as.raw(c(0xa5, 0x11, 0xaa, 0xa5, 0x11, 0x00))
match <- matchBytes(buf, 0xa5, 0x11)
print(buf)
print(match)
Run the code above in your browser using DataLab