Beispiel #1
0
        private void ParseEntries(ArchiveListingEntryInfoV1[] entries, ArchiveListingCompressedData data, ArchiveListing result)
        {
            byte[] buff = new byte[0];

            for (int currentBlock = -1, i = 0; i < entries.Length; i++)
            {
                ArchiveListingEntryInfoV1 entryInfoV1 = entries[i];
                if (entryInfoV1.BlockNumber != currentBlock)
                {
                    currentBlock = entryInfoV1.BlockNumber;
                    buff = data.AcquireData(currentBlock);
                }

                string name;
                long sector, uncompressedSize, compressedSize;
                ParseInfo(entryInfoV1, buff, out sector, out uncompressedSize, out compressedSize, out name);

                ArchiveEntry entry = new ArchiveEntry(name, sector, compressedSize, uncompressedSize)
                {
                    UnknownNumber = entryInfoV1.UnknownNumber,
                    UnknownValue = entryInfoV1.UnknownValue
                };

                result.Add(entry);
                _progressIncrement.NullSafeInvoke(1);
            }
        }
Beispiel #2
0
        public ArchiveListing Read()
        {
            ArchiveListingHeaderV2 header;

            using (Stream input = Decrypt(out header))
            {
                _progressTotalChanged.NullSafeInvoke(header.EntriesCount);

                short blockNumber = -1;
                bool? flag        = null;

                ArchiveListingEntryInfoV2[] entries = new ArchiveListingEntryInfoV2[header.EntriesCount];
                for (int i = 0; i < entries.Length; i++)
                {
                    entries[i] = input.ReadContent <ArchiveListingEntryInfoV2>();
                    if (entries[i].Flag != flag)
                    {
                        flag = entries[i].Flag;
                        blockNumber++;
                    }
                    entries[i].BlockNumber = blockNumber;
                }

                ArchiveListingCompressedData data = new ArchiveListingCompressedData(header);
                data.ReadFromStream(input);

                ArchiveListing result = new ArchiveListing(_accessor, header);
                ParseEntries(entries, data, result);
                return(result);
            }
        }
Beispiel #3
0
        private void ParseEntries(ArchiveListingEntryInfoV2[] entries, ArchiveListingCompressedData data, ArchiveListing result)
        {
            byte[] buff = new byte[0];

            for (int currentBlock = -1, i = 0; i < entries.Length; i++)
            {
                ArchiveListingEntryInfoV2 entryInfoV2 = entries[i];
                if (entryInfoV2.BlockNumber != currentBlock)
                {
                    currentBlock = entryInfoV2.BlockNumber;
                    buff         = data.AcquireData(currentBlock);
                }

                string name;
                long   sector, uncompressedSize, compressedSize;
                ParseInfo(entryInfoV2, buff, out sector, out uncompressedSize, out compressedSize, out name);

                ArchiveEntry entry = new ArchiveEntry(name, sector, compressedSize, uncompressedSize)
                {
                    UnknownNumber = entryInfoV2.UnknownNumber,
                    UnknownValue  = entryInfoV2.UnknownValue,
                    UnknownData   = entryInfoV2.UnknownData
                };

                result.Add(entry);
                _progressIncrement.NullSafeInvoke(1);
            }
        }
        public ArchiveListing Read()
        {
            ArchiveListingHeaderV2 header;
            Stream input = Decrypt(out header);

            _progressTotalChanged.NullSafeInvoke(header.EntriesCount);

            short blockNumber = -1;
            bool? flag = null;

            ArchiveListingEntryInfoV2[] entries = new ArchiveListingEntryInfoV2[header.EntriesCount];
            for (int i = 0; i < entries.Length; i++)
            {
                entries[i] = input.ReadContent<ArchiveListingEntryInfoV2>();
                if (entries[i].Flag != flag)
                {
                    flag = entries[i].Flag;
                    blockNumber++;
                }
                entries[i].BlockNumber = blockNumber;
            }

            ArchiveListingCompressedData data = new ArchiveListingCompressedData(header);
            data.ReadFromStream(input);

            ArchiveListing result = new ArchiveListing(_accessor, header.EntriesCount);
            ParseEntries(entries, data, result);
            return result;
        }
Beispiel #5
0
        public ArchiveListing Read()
        {
            ArchiveListingHeader header = _input.ReadStruct<ArchiveListingHeader>();
            _progressTotalChanged.NullSafeInvoke(header.EntriesCount);

            ArchiveListingEntryInfoV1[] entries = _input.ReadStructs<ArchiveListingEntryInfoV1>(header.EntriesCount);

            ArchiveListingCompressedData data = new ArchiveListingCompressedData(header);
            data.ReadFromStream(_input);

            ArchiveListing result = new ArchiveListing(_accessor, header.EntriesCount);
            ParseEntries(entries, data, result);
            return result;
        }
Beispiel #6
0
        public ArchiveListing Read()
        {
            ArchiveListingHeaderV1 header = _input.ReadStruct <ArchiveListingHeaderV1>();

            _progressTotalChanged.NullSafeInvoke(header.EntriesCount);

            ArchiveListingEntryInfoV1[] entries = _input.ReadStructs <ArchiveListingEntryInfoV1>(header.EntriesCount);

            ArchiveListingCompressedData data = new ArchiveListingCompressedData(header);

            data.ReadFromStream(_input);

            ArchiveListing result = new ArchiveListing(_accessor, header);

            ParseEntries(entries, data, result);
            return(result);
        }