code: private final boolean matchPattern(byte[][] patterns, int bufferIndex)
     {
        boolean match = false;
        for (byte[] pattern : patterns)
        {
           int index = 0;
           match = true;
           for (byte b : pattern)
           {
              if (b != m_buffer[bufferIndex + index])
              {
                 match = false;
                 break;
              }
              ++index;
           }
           if (match)
           {
              break;
           }
        }
        return match;
     }
docs: Locate a feature in the file by match a byte pattern.
  
  @param patterns patterns to match
  @param bufferIndex start index
  @return true if the bytes at the position match a pattern