match.bytes {oce}R Documentation

Find spots in a raw vector that match a given byte sequence.

Description

Find spots in a raw vector that match a given byte sequence.

Usage

match.bytes(input, b1, ...)

Arguments

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 which).
... additional bytes to match for (up to 2 permitted)

Value

List of the indices of input that match the start of the bytes sequence (see example).

Author(s)

Dan Kelley

Examples

buf <- as.raw(c(0xa5, 0x11, 0xaa, 0xa5, 0x11, 0x00))
match <- match.bytes(buf, 0xa5, 0x11)
print(buf)
print(match)

[Package oce version 0.1-80 Index]