Accord.Video.ByteArrayUtils.Compare C# (CSharp) Method

Compare() public static method

Check if the array contains needle at specified position.
public static Compare ( byte array, byte needle, int startIndex ) : bool
array byte Source array to check for needle.
needle byte Needle we are searching for.
startIndex int Start index in source array.
return bool
        public static bool Compare( byte[] array, byte[] needle, int startIndex )
        {
            int needleLen = needle.Length;
            // compare
            for ( int i = 0, p = startIndex; i < needleLen; i++, p++ )
            {
                if ( array[p] != needle[i] )
                {
                    return false;
                }
            }
            return true;
        }
ByteArrayUtils