public static int IndexOf<T>(this IList<T> list, T[] findBytes, int index = 0)
{
int iRet = -1;
for (int i = index; i < list.Count - findBytes.Length; i++)
{
int iEqualsCount = 0;
for (int j = 0; j < findBytes.Length; j++)
{
if (list[i + j].Equals(findBytes[j]))
{
iEqualsCount++;
}
}
if (iEqualsCount == findBytes.Length)
{
iRet = i;
break;
}
}
return iRet;
}