Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8301847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:08:43+00:00 2026-06-08T17:08:43+00:00

When I used the SharpZipLib to unzip a zip file which has 5000 files

  • 0

When I used the SharpZipLib to unzip a zip file which has 5000 files on the windows phone 7. It took more than 5 minutes to finish it.
Here is the code:

using (StreamReader httpwebStreamReader = new StreamReader(ea.Result))
            {
                //open isolated storage to save files
                using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    using (ZipInputStream s = new ZipInputStream(httpwebStreamReader.BaseStream))
                    {
                        //s.Password = "123456";//if archive is encrypted
                        ZipEntry theEntry;
                        while ((theEntry = s.GetNextEntry()) != null)
                        {
                            string directoryName = Path.GetDirectoryName(theEntry.Name);
                            string fileName = Path.GetFileName(theEntry.Name);

                            // create directory
                            if (directoryName.Length > 0)
                            {
                                isoStore.CreateDirectory(directoryName);
                            }

                            if (fileName != String.Empty)
                            {
                                //save file to isolated storage
                                using (BinaryWriter streamWriter =
                                        new BinaryWriter(new IsolatedStorageFileStream(theEntry.Name,
                                            FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write, isoStore)))
                                {

                                    int size = 2048;
                                    byte[] data = new byte[2048];
                                    while (true)
                                    {
                                        size = s.Read(data, 0, data.Length);
                                        if (size > 0)
                                        {
                                            streamWriter.Write(data, 0, size);
                                        }
                                        else
                                        {
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

Why it’s so slow?
How can I speed up the unzip action?
Anyone knows?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:08:44+00:00Added an answer on June 8, 2026 at 5:08 pm

    I think you need to increase your buffer size. Change the lines

    int size = 2048;
    byte[] data = new byte[2048];
    

    And change the 2048 to something like 32768 (32*1024).

    A 2KB block size is making a lot of individual writes to the flash storage. In my experience that’s a somewhat slow thing and can vary from device to device. A 32KB block size should do 16 times fewer but I don’t know if that will result in a direct 16x speedup. I’m interested to hear back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a zip file that contains folder hierarchies and files. \images\ \images\1.jpg \images\2.jpg
I am using Sharpziplib version 0.86 to extract a zip file. It is working
I'm creating a zip file using the class FastZip from SharpZipLib and once I
used a script to rename a column which has caused a problem... sp_RENAME 'products.isvalid'
I used the phonegap website to create an IPA file. Now I want to
I used this code which found on forum without errors in 4.0.2a and now
I used the follwoing statement to copy over files from one folder to another...
I used following command on windows xp and its working perfectly fine. rundll32.exe url.dll,FileProtocolHandler
I have used this code given by Marc Gravell in SO to unzip a
Used http://www.ilbcfreeware.org/software.html - I only get static from the files that ilbc_test.exe creates. Does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.