matchBytes | R Documentation |
Find spots in a raw vector that match a given byte sequence.
matchBytes(input, b1, ...)
input |
a vector of raw (byte) values. |
b1 |
a vector of bytes to match (must be of length 2 or 3 at present;
for 1-byte, use |
... |
additional bytes to match for (up to 2 permitted) |
matchBytes
returns a double vector of the indices of input
that
match the start of the bytes
sequence. (A double vector is returned
instead of an integer vector, to avoid problems with large files.)
Dan Kelley
buf <- as.raw(c(0xa5, 0x11, 0xaa, 0xa5, 0x11, 0x00))
print(buf)
print(matchBytes(buf, 0xa5, 0x11))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.