Extracting a file out of the archive is working great. I decided to move the decompression function into the class that reads and parses the file. I also added a place to store the datablock in the FileItem class. I think this will help when I finish the import routine, because I will need to rewrite the file, I will have to recalculate the offsets. Ok, so that does not really explain why.. but I will have the output routine in the class that has the ArrayList of FileItems, so it can write out the file index, and because the file uses an offset that starts at the end of the index I don't need to calculate it. It should go something like this, item.offset = sum_of_all_previous_items_lengths. The first index always has an offset of 0, this is handy.
Anyways, I'm not much of a writer so I'll just get on to coding today. I hope I can finish the importing this morning.
I came up with a funny question...
When dealing with compressed files that are being read off of a hard disk, is it faster (with modern processors) to read in 9,000 bytes and decompress it in to memory, or read in the uncompressed 900,000 bytes stright in to memory? I know that the HDD is the slowest deice in the system, but 900,000 bytes isn't alot. I do think it is faster to decompress the chunk in memory, but I want to write a feature for this program that will rearchive the file with lower compression, to see if I am wrong. To see if the game actually loads faster because of the reduced compression. Too bad I probally will not be able to actually measure the difference. I can't think of anything other than my wrist watch that will be able to time the length of the loading screens for the game.
Until next time.