Esempio n. 1
0
 private void Read(BinaryReaderEx br)
 {
     br          = SFUtil.GetDecompressedBR(br, out DCX.Type compression);
     Compression = compression;
     Files       = BND3.ReadHeader(this, br);
     DataBR      = br;
 }
Esempio n. 2
0
 /// <summary>
 /// Returns true if the file appears to be a BXF3 data file.
 /// </summary>
 public static bool IsBDT(string path)
 {
     using (FileStream fs = System.IO.File.OpenRead(path))
     {
         BinaryReaderEx br = new BinaryReaderEx(false, fs);
         return(IsBDT(SFUtil.GetDecompressedBR(br, out _)));
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Loads a file from a byte array, automatically decompressing it if necessary.
        /// </summary>
        public static TFormat Read(byte[] bytes)
        {
            BinaryReaderEx br   = new BinaryReaderEx(false, bytes);
            TFormat        file = new TFormat();

            br = SFUtil.GetDecompressedBR(br, out file.Compression);
            file.Read(br);
            return(file);
        }
Esempio n. 4
0
        /// <summary>
        /// Loads a DRB from a byte array, automatically decompressing it if necessary.
        /// </summary>
        public static DRB Read(byte[] bytes, DRBVersion version)
        {
            BinaryReaderEx br  = new BinaryReaderEx(false, bytes);
            DRB            drb = new DRB();

            br = SFUtil.GetDecompressedBR(br, out drb.Compression);
            drb.Read(br, version);
            return(drb);
        }
Esempio n. 5
0
        public static FLVER2 Read(byte[] bytes, FlverCache cache)
        {
            BinaryReaderEx br   = new BinaryReaderEx(false, bytes);
            FLVER2         file = new FLVER2();

            file.Cache = cache;
            br         = SFUtil.GetDecompressedBR(br, out file.Compression);
            file.Read(br);
            return(file);
        }
Esempio n. 6
0
 /// <summary>
 /// Loads a file from the specified path, automatically decompressing it if necessary.
 /// </summary>
 public static TFormat Read(string path)
 {
     using (FileStream stream = File.OpenRead(path))
     {
         BinaryReaderEx br   = new BinaryReaderEx(false, stream);
         TFormat        file = new TFormat();
         br = SFUtil.GetDecompressedBR(br, out file.Compression);
         file.Read(br);
         return(file);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Loads a DRB from the specified path, automatically decompressing it if necessary.
 /// </summary>
 public static DRB Read(string path, DRBVersion version)
 {
     using (FileStream stream = File.OpenRead(path))
     {
         BinaryReaderEx br  = new BinaryReaderEx(false, stream);
         DRB            drb = new DRB();
         br = SFUtil.GetDecompressedBR(br, out drb.Compression);
         drb.Read(br, version);
         return(drb);
     }
 }
Esempio n. 8
0
        /// <summary>
        /// Returns true if the bytes appear to be a DRB.
        /// </summary>
        public static bool Is(byte[] bytes)
        {
            if (bytes.Length == 0)
            {
                return(false);
            }

            BinaryReaderEx br = new BinaryReaderEx(false, bytes);

            return(Is(SFUtil.GetDecompressedBR(br, out _)));
        }
Esempio n. 9
0
 /// <summary>
 /// Loads a file from the specified path, automatically decompressing it if necessary.
 /// </summary>
 public static FLVER2 Read(string path, FlverCache cache)
 {
     using (FileStream stream = File.OpenRead(path))
     {
         BinaryReaderEx br   = new BinaryReaderEx(false, stream);
         FLVER2         file = new FLVER2();
         file.Cache = cache;
         br         = SFUtil.GetDecompressedBR(br, out file.Compression);
         file.Read(br);
         return(file);
     }
 }
Esempio n. 10
0
        /// <summary>
        /// Returns true if the file appears to be a DRB.
        /// </summary>
        public static bool Is(string path)
        {
            using (FileStream stream = File.OpenRead(path))
            {
                if (stream.Length == 0)
                {
                    return(false);
                }

                BinaryReaderEx br = new BinaryReaderEx(false, stream);
                return(Is(SFUtil.GetDecompressedBR(br, out _)));
            }
        }
Esempio n. 11
0
        private static bool IsRead(BinaryReaderEx br, out TFormat file)
        {
            var test = new TFormat();

            br = SFUtil.GetDecompressedBR(br, out test.Compression);
            if (test.Is(br))
            {
                br.Position = 0;
                test.Read(br);
                file = test;
                return(true);
            }
            else
            {
                file = null;
                return(false);
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Returns true if the file appears to be a BXF3 data file.
        /// </summary>
        public static bool IsBDT(byte[] bytes)
        {
            BinaryReaderEx br = new BinaryReaderEx(false, bytes);

            return(IsBDT(SFUtil.GetDecompressedBR(br, out _)));
        }