Esempio n. 1
0
        static void ConvertEntry(ref PAKToolArchiveEntry entry)
        {
            using (MemoryStream mStream = new MemoryStream(entry.Data))
            {
                if (PAKToolArchiveFile.VerifyFileType(mStream))
                {
                    PAKToolArchiveFile subPak = new PAKToolArchiveFile(mStream);
                    for (int i = 0; i < subPak.EntryCount; i++)
                    {
                        PAKToolArchiveEntry subEntry = subPak.Entries[i];
                        ConvertEntry(ref subEntry);
                        subPak.Entries[i] = subEntry;
                    }

                    entry = new PAKToolArchiveEntry(entry.Name, ListArchiveFile.Create(subPak).GetBytes());
                }
            }
        }
Esempio n. 2
0
        private void InternalRead(BinaryReader reader)
        {
            // Read first entry
            PAKToolArchiveEntry entry = new PAKToolArchiveEntry(reader);

            while (entry.DataLength != 0)
            {
                // Entry wasn't empty, so add a new one to the list
                Entries.Add(entry);

                if (reader.BaseStream.Position == reader.BaseStream.Length)
                {
                    break;
                }

                // Read next entry
                entry = new PAKToolArchiveEntry(reader);
            }
        }