Пример #1
0
 public static Mini GetMini(string path)
 {
     path         = FileMitm.GetRedirectedReadPath(path);
     using var fs = new FileStream(path, FileMode.Open, FileAccess.Read);
     using var br = new BinaryReader(fs);
     return(GetMini(br));
 }
Пример #2
0
        public static Mini GetMini(string path)
        {
            path         = FileMitm.GetRedirectedReadPath(path);
            using var fs = new FileStream(path, FileMode.Open, FileAccess.Read);
            using var br = new BinaryReader(fs);
            var result = GetMini(br);

            if (result is null)
            {
                throw new FormatException($"The file at {path} is not a {nameof(Mini)} file.");
            }
            return(result);
        }