Example #1
0
 internal MpqStream(MpqArchive archive, MpqEntry entry)
 {
     this._entry     = entry;
     this._stream    = archive.BaseStream;
     this._blockSize = archive.BlockSize;
     if (this._entry.IsCompressed && !this._entry.IsSingleUnit)
     {
         this.LoadBlockPositions();
     }
 }
Example #2
0
        internal MpqStream(MpqArchive archive, MpqEntry entry)
        {
            _entry = entry;

            _stream = archive.BaseStream;
            _blockSize = archive.BlockSize;

            if (_entry.IsCompressed && !_entry.IsSingleUnit)
                LoadBlockPositions();
        }
Example #3
0
        internal MpqStream(MpqEntry entry, Stream baseStream, int blockSize)
        {
            _entry = entry;

            _stream    = baseStream;
            _blockSize = blockSize;

            if (_entry.IsCompressed && !_entry.IsSingleUnit)
            {
                LoadBlockPositions();
            }
        }
Example #4
0
        public MpqFile(Stream sourceStream, string fileName, MpqFileFlags flags, ushort blockSize)
        {
            _baseStream = sourceStream;
            _fileName   = fileName;

            _blockSize = 0x200 << blockSize;

            var fileSize       = (uint)_baseStream.Length;
            var compressedSize = ((flags & MpqFileFlags.Compressed) != 0) ? Compress() : fileSize;

            _entry = new MpqEntry(fileName, compressedSize, fileSize, flags);
        }