コード例 #1
0
 internal WadEntry(Wad wad, ulong xxhash, int compressedSize, int uncompressedSize, WadEntryType entryType, byte[] sha, string fileRedirection, uint dataOffset)
 {
     this._wad             = wad;
     this.XXHash           = xxhash;
     this.CompressedSize   = compressedSize;
     this.UncompressedSize = uncompressedSize;
     this.Type             = entryType;
     this.SHA             = sha;
     this.FileRedirection = fileRedirection;
     this._dataOffset     = dataOffset;
 }
コード例 #2
0
        internal WadEntry(Wad wad, BinaryReader br, byte major)
        {
            this._wad             = wad;
            this.XXHash           = br.ReadUInt64();
            this._dataOffset      = br.ReadUInt32();
            this.CompressedSize   = br.ReadInt32();
            this.UncompressedSize = br.ReadInt32();
            this.Type             = (WadEntryType)br.ReadByte();
            this._isDuplicated    = br.ReadBoolean();
            br.ReadUInt16(); // pad
            if (major >= 2)
            {
                this.SHA = br.ReadBytes(8);
            }

            if (this.Type == WadEntryType.FileRedirection)
            {
                long currentPosition = br.BaseStream.Position;
                br.BaseStream.Seek(this._dataOffset, SeekOrigin.Begin);
                this.FileRedirection = Encoding.ASCII.GetString(br.ReadBytes(br.ReadInt32()));
                br.BaseStream.Seek(currentPosition, SeekOrigin.Begin);
            }
        }