internal unsafe WZBinaryReader Clone() { WZBinaryReader ret = new WZBinaryReader(_start, _end - _start, _aes, VersionHash); ret._cur = _cur; return(ret); }
/// <summary>Creates and loads a WZ file from a path. The Stream created will be disposed when the WZ file is disposed.</summary> /// <param name="path"> The path where the WZ file is located. </param> /// <param name="variant"> The variant of this WZ file. </param> /// <param name="encrypted"> Whether the WZ file is encrypted outside a WZ image. </param> /// <param name="flag"> WZ parsing flags. </param> public unsafe WZFile(string path, WZVariant variant, bool encrypted, WZReadSelection flag = WZReadSelection.None) { _variant = variant; _encrypted = encrypted; _flag = flag; _aes = new WZAES(_variant); _bpo = new MemoryMappedFile(path); _r = new WZBinaryReader(_bpo.Pointer, _bpo.Length, _aes, 0); Parse(); }