I use SharpZipLib for gzip on a Windows Mobile application written in c#
I have this code
public static bool gzDecompressFile(String inputFilePath, String outputFilePath)
{
if (!File.Exists(inputFilePath))
return false;
if (File.Exists(outputFilePath))
File.Delete(outputFilePath);
FileStream fs = File.OpenRead(inputFilePath);
FileStream fsOut = File.OpenWrite(outputFilePath);
GZipInputStream gzipIn = new GZipInputStream(fs);
// Compress file in 1kb chunks
byte[] chunk = new byte[1024];
int read = 1;
while (read > 0)
{
read = gzipIn.Read(chunk, 0, chunk.Length);
if (read > 0)
{
fsOut.Write(chunk, 0, read);
}
}
fsOut.Close();
fs.Close();
return true;
}
For a 1.6MB --> 7MB decompression it takes 4-5 minutes.
Do you know a better one for Compact Framework?