dir.mkdirs();
mpqFile.delete();
long start = System.currentTimeMillis();
ReadWriteMpqArchive mpqArchive = new MpqArchive(mpqFile, true);
int count = countFiles(dir);
int hashTableSize = Integer.highestOneBit(count * 4 / 3) << 1;
mpqArchive.initHashtable(hashTableSize);
addDir(mpqArchive, dir, "");
mpqArchive.saveMetadata();
mpqArchive.close();
long end = System.currentTimeMillis();
System.out.println("Took: " + (end - start) + "ms");
}