public void AddFiles(IEnumerable<FileInfo> files, DirectoryInfo rootAssetsFolder = null)
        {
            var packDirectory = new List<PackDirectoryEntry>();

            var bytesCount = 0;

            foreach (var file in files)
            {
                var entry = new PackDirectoryEntry();

                if(rootAssetsFolder != null)
                {
                    entry.FileName = file.FullName.Replace(rootAssetsFolder.FullName, "");
                }
                else
                {
                    entry.FileName = file.Name;
                }

                entry.FileLength = (int)file.Length;
                entry.FilePosition = bytesCount; // file size + file length + file offset

                entry.FileData = file;

                bytesCount += (int)file.Length;

                packDirectory.Add(entry);
            }

            PakDirectory.AddEntryList(packDirectory);
        }
        public void AddDirectoryFiles(DirectoryInfo dir, Func<FileInfo, bool> fileSelectionPredicate)
        {
            var packDirectory = new List<PackDirectoryEntry>();

            var files = dir.EnumerateFiles("*", SearchOption.AllDirectories).Where(fileSelectionPredicate);

            var bytesCount = 0;

            foreach (var file in files)
            {
                var entry = new PackDirectoryEntry();
                entry.FileName = file.FullName.Replace(dir.FullName, "");
                entry.FileLength = (int)file.Length;
                entry.FilePosition = bytesCount;

                entry.FileData = file;

                bytesCount += (int)file.Length;

                packDirectory.Add(entry);
            }

            PakDirectory.AddEntryList(packDirectory);
        }
            public void AddEntry(FileInfo file)
            {
                var entry = new PackDirectoryEntry();

                if(_rootDir == null)
                {
                    entry.FileName = file.Name;
                }else{
                    entry.FileName = file.FullName.Replace(_rootDir.FullName, "");
                }

                entry.FileLength = (int)file.Length;
                entry.FilePosition = bytesOffset;
                entry.FileData = file;

                bytesOffset += entry.FileLength;
            }