SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Need help fixing bad CRC errors:

Last post 10-28-2006 4:32 AM by JohnReilly. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-28-2006 12:23 AM

    Need help fixing bad CRC errors:

    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? 

    Kenn Min Chong
    Network Engineer
    www.browsercam.com
    www.emailreach.com
  • 10-28-2006 4:32 AM In reply to

    Re: Need help fixing bad CRC errors:

    Hi,

    Make sure you have the latest version of the library.

    try SetLevel(9).

    Tip: Dont allocate a buffer the size of each file each time, its a huge memory overhead.

    hth, -jr-

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.