예제 #1
0
        private void ReadMetadata(EndianReader reader)
        {
            string signature = reader.ReadStringZeroTerm();

            if (signature != Signature)
            {
                throw new Exception($"Signature '{signature}' doesn't match to '{Signature}'");
            }

            SmartStream         webStream = (SmartStream)reader.BaseStream;
            List <WebFileEntry> entries   = new List <WebFileEntry>();
            long headerLength             = reader.ReadInt32();

            while (webStream.Position < headerLength)
            {
                int    offset     = reader.ReadInt32();
                int    length     = reader.ReadInt32();
                int    pathLength = reader.ReadInt32();
                string path       = reader.ReadString(pathLength);

                WebFileEntry entry = new WebFileEntry(webStream, m_filePath, path, offset, length);
                entries.Add(entry);
            }
            Metadata = new WebMetadata(entries);
        }
        public void Read(EndianReader reader)
        {
            List <WebFileEntry> entries = new List <WebFileEntry>();
            long metadataLength         = reader.ReadInt32();

            while (reader.BaseStream.Position < metadataLength)
            {
                WebFileEntry entry = new WebFileEntry();
                entry.Read(reader);
                entries.Add(entry);
            }
            Entries = entries.ToArray();
        }
예제 #3
0
        public void Read(EndianReader reader)
        {
            Dictionary <string, WebFileEntry> entries = new Dictionary <string, WebFileEntry>();
            long metadataLength = reader.ReadInt32();

            while (reader.BaseStream.Position < metadataLength)
            {
                WebFileEntry entry = new WebFileEntry();
                entry.Read(reader);
                entries.Add(entry.Name, entry);
            }
            Entries = entries;
        }