Hi there!
Whenever I zip up multiple files of about 0.5MB each, I'm getting bad CRC errors when I try to unzip the resulting Zip file. Below is what I'm basically doing:
ZipOutputStream s = null;
s = new ZipOutputStream(File.Create(zipName));
s.SetLevel(0);
foreach (string file in filenames)
{
if(File.Exists(file))
{
FileStream fs = File.OpenRead(file);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
FileInfo fi = new FileInfo(file);
ZipEntry entry = new ZipEntry(fi.Name);
s.PutNextEntry(entry);
s.Write(buffer, 0, buffer.Length);
fs.Close();
}
}
s.Finish();
s.Close();
Can someone tell me what is it I'm doing wrong here?