/// <inheritdoc /> public List <string> Match(byte[] data, bool matchAll = false) { var rawResults = _innerSniffer.Match(data, matchAll); return(_expectedCount == 0 ? rawResults : Filter(rawResults, _expectedResults).ToList()); }
public IActionResult Sniffer() { var path = _env.WebRootFileProvider.GetFileInfo("img/sniffer.jpg").PhysicalPath; byte[] array = new byte[20]; using (var file = System.IO.File.Open(path, FileMode.Open)) { file.Read(array, 0, array.Length); } var results = _sniffer.Match(array, true); var statistics = _sniffer.GetMetadataStatistics(); var content = $@" statistics: total={statistics.Total} result: {results.ToListString()} "; return(Content(content)); }