ByteReader.maskedScanUint32Peek

uint maskedScanUint32Peek(uint mask, uint pattern, uint offset, uint size, out uint value)

Scan for pattern pattern with applied mask mask in the byte reader data, starting from offset offset relative to the current position.

The bytes in pattern and mask are interpreted left-to-right, regardless of endianness. All four bytes of the pattern must be present in the byte reader data for it to match, even if the first or last bytes are masked out.

It is an error to call this function without making sure that there is enough data (offset+size bytes) in the byte reader.

Parameters

maskmask to apply to data before matching against pattern
patternpattern to match (after mask is applied)
offsetoffset from which to start scanning, relative to the current position
sizenumber of bytes to scan from offset
valuepointer to uint32 to return matching data

Returns

offset of the first match, or -1 if no match was found.