There's no nested loop in the code posted by Alberto - it looks like a
pretty simple way of doing things to me.
Well, Alberto's code assumes that you know ahead of time the three-byte
sequence you're looking for. For the specific example, it appears that's
fine, but since a general solution isn't hard to write I'd think it would
make more sense to do so. Then if the constants change or may be
determined dynamically at some point, the "hard" work is already done
(such as it is

).
I'm not sure I quite see how your IndexOf solution would be simpler,
but I could well be missing a trick. If you've got the time, could you
post some sample code?
No.
I thought about it some more and decided that a couple of nested loops
really isn't that bad, and that the recursion I was thinking of is
overkill for the specific situation. So I'll take back what I wrote about
a recursive solution taking advantage of the IndexOf() method. Sorry.
It might be interesting to write a generic "sequence within sequence"
finder some time. Wouldn't be too hard - with a signature of something
like:
int IndexOf<T> (IList<T> haystack, IList<T> needle)
where T : IEquatable<T>
which would cope with arrays automatically. Hmm. Maybe I should add it
to the wishlist for my MiscUtil library...
Sure. Though alternatively, the Array class already has generic "Find"
methods that take a predicate delegate as a parameter. It seems that a
future addition to the Array class in .NET itself should be this exact
functionality. To me, a String is really just a special-purpose array so
it seems natural to extend the existing Array class within .NET to support
the functionality String already has.
Pete