Пример #1
0
 internal PakEntry(Stream stream, string directory, PakManifestFile manifest)
 {
     _stream = stream;
     _directory = directory;
     _manifest = manifest;
 }
Пример #2
0
        private PakManifestFile ReadFile()
        {
            var file = new PakManifestFile();

            file.Checksum = _reader.ReadUInt32();
            
            byte typeByte = _reader.ReadByte();
            PakFileType type;
            if(!Enum.TryParse<PakFileType>(((int)typeByte).ToString(), out type))
            {
                throw new InvalidDataException(string.Format("Invalid file type! (Type: {0})", (int)typeByte));
            }

            file.Type = type;
            file.Name = ReadString();
            file.Offset = _reader.ReadUInt32();
            file.UncompressedSize = _reader.ReadUInt32();
            file.Timestamp = _reader.ReadUInt64();

            return file;
        }