Beispiel #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));
 }
Beispiel #2
0
 public static byte[] PackMini(string[] files, string identifier)
 {
     byte[][] fileData = new byte[files.Length][];
     for (int i = 0; i < fileData.Length; i++)
     {
         fileData[i] = FileMitm.ReadAllBytes(files[i]);
     }
     return(PackMini(fileData, identifier));
 }
Beispiel #3
0
 public static string GetIsMini(string path)
 {
     try
     {
         path         = FileMitm.GetRedirectedWritePath(path);
         using var fs = new FileStream(path, FileMode.Open);
         using var br = new BinaryReader(fs);
         return(GetIsMini(br));
     }
     catch { return(null); }
 }
Beispiel #4
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);
        }
Beispiel #5
0
 public GFPack(string path) : this(FileMitm.ReadAllBytes(path)) => FilePath = path;
Beispiel #6
0
 public static byte[][] UnpackMini(string file, string identifier = null)
 {
     byte[] fileData = FileMitm.ReadAllBytes(file);
     return(UnpackMini(fileData, identifier));
 }