Ejemplo n.º 1
0
        public Range SearchFor(byte[] pattern, int start)
        {
            var searcher   = new KMPMatch();
            var matchIndex = searcher.IndexOf(_buffer.ToArray(), pattern, start);

            return(matchIndex != -1
                ? new Range(matchIndex, pattern.Length)
                    : new Range(matchIndex, 0));
        }
Ejemplo n.º 2
0
        public virtual Range SearchFor(byte[] pattern, int start)
        {
            KMPMatch searcher   = new KMPMatch();
            int      matchIndex = searcher.IndexOf(buffer.ToByteArray(), pattern, start);

            if (matchIndex != -1)
            {
                return(new Range(matchIndex, pattern.Length));
            }
            else
            {
                return(new Range(matchIndex, 0));
            }
        }
 public Range SearchFor(byte[] pattern, int start)
 {
     var searcher = new KMPMatch();
     var matchIndex = searcher.IndexOf(buffer.ToArray(), pattern, start);
     return matchIndex != -1 
         ? new Range (matchIndex, pattern.Length) 
             : new Range (matchIndex, 0);
 }
Ejemplo n.º 4
0
		public virtual Range SearchFor(byte[] pattern, int start)
		{
			KMPMatch searcher = new KMPMatch();
			int matchIndex = searcher.IndexOf(buffer.ToByteArray(), pattern, start);
			if (matchIndex != -1)
			{
				return new Range(matchIndex, pattern.Length);
			}
			else
			{
				return new Range(matchIndex, 0);
			}
		}