Check Match for byte array pattern - CSharp System

CSharp examples for System:Byte Array

Description

Check Match for byte array pattern

Demo Code


using System.Text;
using System.Collections.Generic;
using System.Collections;
using System;//from   w  ww . j ava2 s.c om

public class Main{
        private static bool CheckMatch(byte[] data, byte[] pattern, int start)
        {
            int p = 0;
            while (start < data.Length && p < pattern.Length)
                if (data[start++] != pattern[p++])
                    return false;

            return true;
        }
}

Related Tutorials