Reading Embedded GZ files

Mar 12, 2012 at 4:21 AM


Can I use the DotNetZipLib to read embedded .gz files?   I've searched through the samples and posts and and didn't find anything addresses my specific needs.  I have .gz files which contain several gz files (example:  file1.gz contains a.gz, b.gz, c.gz, and so on).  I want to read these embedded gz files on the fly using streamreader (or similar).  I'm writing in VB .NET (VS 2010).  Here is a short snippit of what I have so far - It reads gz files which do not contain embedded gz files.  I need to be able to drill into the embedded gz file to parse it.  Any suggestion would be appreciated.

Thank You


For Each fi As FileInfo In di.GetFiles("*.gz")

fullPath = dirpath + "\" + fi.ToString

dirInstream = New GZipStream(File.OpenRead(fullPath), CompressionMode.Decompress)
reader = New StreamReader(dirInstream)

Do While Not readLine Is Nothing

'--- Do some work on readLine

readLine = reader.ReadLine