SWThomas
August 19th, 1999, 05:36 PM
I have an application in which I would like to be able to return to any one of a number of previously "marked" positions within a compressed (gzip) file. The input file is large enough that I'd rather not have to unzip it before starting the application (unzipped it can be upwards of 100Mb).
The mark() method of GZipInputStream doesn't hack it for this application. Ideally, I'd like a GZip input class based on RandomAccessFile, and which knew how to save and restore its internal state into/from a memento (see Design Patterns book if you aren't familiar with Memento). Has anyone implemented such a thing? Does anyone have a GZip reader source that I could modify to build such a thing?
The other way that I've thought of is to decompress the gzipped file into a temporary RandomAccessFile as I'm reading it. Then I can seek back to previous positions in the RandomAccessFile, and continue to read forward in the gzipped file.
Thanks for any insight you can give.
The mark() method of GZipInputStream doesn't hack it for this application. Ideally, I'd like a GZip input class based on RandomAccessFile, and which knew how to save and restore its internal state into/from a memento (see Design Patterns book if you aren't familiar with Memento). Has anyone implemented such a thing? Does anyone have a GZip reader source that I could modify to build such a thing?
The other way that I've thought of is to decompress the gzipped file into a temporary RandomAccessFile as I'm reading it. Then I can seek back to previous positions in the RandomAccessFile, and continue to read forward in the gzipped file.
Thanks for any insight you can give.