public static bool TryParse(byte[] bytes, out TorrentParser torrentParser) { try { torrentParser = new TorrentParser(bytes); return(true); } catch (Exception) { torrentParser = null; return(false); } }
public static bool TryParse(string path, out TorrentParser torrentParser) { try { torrentParser = new TorrentParser(File.ReadAllBytes(path)); return(true); } catch (Exception) { torrentParser = null; return(false); } }