byte array Ends With Pattern - CSharp System

CSharp examples for System:Byte Array

Description

byte array Ends With Pattern

Demo Code


using System.Text;
using System.Collections.Generic;
using System.Collections;
using System;/*from   w ww.  j  a va  2 s.  c o m*/

public class Main{
        public static bool EndsWithPattern(this byte[] data, byte[] pattern)
        {
            return data.HasPatternAt(pattern, data.Length - pattern.Length);
        }
        public static bool HasPatternAt(this byte[] data, byte[] pattern, int position)
        {
            return CheckMatch(data, pattern, position);
        }
}

Related Tutorials