BinUtils.cs
/// <summary>
/// Searched through 'data' for the givenBytes.
/// </summary>
/// <param name="startLocation">Where to start in 'data'</param>
/// <param name="givenBytes">the stuff to look for</param>
/// <param name="data">the big data to look through</param>
/// <returns>location of the givenBytes, -1L if not found.</returns>
Searched through 'data' for the givenBytes.
Searched through ' data ' for the givenBytes .
public static long GetLocationOfGivenBytes(long startLocation, byte[] givenBytes, byte[] data, long maxDistance)
        {
            long retVal = -1L;
            long num = (long)(data.Length - givenBytes.Length);
            for (long location = startLocation; location < num; ++location)
            {
                if (Find(givenBytes, location, data))
                {
                    retVal = location;
                    break;
                }
                else if (maxDistance < location - startLocation)
                    break;
            }
            return retVal;
        }
public static long GetLocationOfGivenBytes ( long startLocation , byte [ ] givenBytes , byte [ ] data , long maxDistance ) { long retVal = - 1L ; long num = ( long ) ( data . Length - givenBytes . Length ) ; for ( long location = startLocation ; location < num ; ++ location ) { if ( Find ( givenBytes , location , data ) ) { retVal = location ; break ; } else if ( maxDistance < location - startLocation ) break ; } return retVal ; }
Searched through 'data' for the givenBytes.
Searched through ' data ' for the givenBytes .
location of the givenBytes, -1L if not found.
location of the givenBytes - 1L if not found .
startLocation
long
None
givenBytes
byte[]
the stuff to look for
the stuff to look for
data
byte[]
the big data to look through
the big data to look through
maxDistance
long