Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
     }
 }