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 6547091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:47:16+00:00 2026-05-25T11:47:16+00:00

I need to read a file from isolated storage (IsolatedStorageFileStream) as fast as possible.

  • 0

I need to read a file from isolated storage (IsolatedStorageFileStream) as fast as possible. Now I read it per byte. I’m sure that reading in chunks of bytes will be faster. But what is the optimal size of these chunks? Have anyone done such tests?

  • 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-05-25T11:47:16+00:00Added an answer on May 25, 2026 at 11:47 am

    Well, I performed test by myself. What I had:
    file size = 3 803 264 bytes; testing code snippet:

    using (var file = storage.OpenFile("test.dat", FileMode.Open))
    {
        var startTime = DateTime.Now;
        const int count = 1;
        var buffer = new byte[count];
        **long position = file.Position;
        **long length = file.Length;
        while (position < length)
        {
            file.Read(buffer, 0, count);
            position += count;
        }
        uxLog.Text = (DateTime.Now - startTime).TotalMilliseconds.ToString();
    }
    

    EDIT: very important point in above snippet is that file.Position and file.Length are requested only once. It has significant positive impact on performance (provided count=1 2370 ms against 55734 ms if position and length are inlined).

    What updated results I’ve got:

    buffer size (bytes) / time in emulator (ms) / time on my HTC Trophy (ms)
    1 / 1197 / 2370
    128 / 725 / 1289
    1024 / 209 / 163
    4096 / 35 / 50
    8196 / 35 / 49
    whole file at once / 19 / 31

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

Sidebar

Related Questions

I need to read the data from a file that can be either comma
I need to play music file from the isolated storage. i did by this
I'm reading data from a file that I need to be put into my
I need to read a file from the local file system using JSP, save
I need to read char[] (size is COUNT) from text file from OFFSET with
I need to read a BufferedImage from file, which doesn't use DataBufferInt (as normally),
i need to read the values from a file(.csv) ,which contains both positive and
I need to read the value of a property from a file in an
I need to read some data from an input file and plot a graph
I need to read data from a legacy database file produced by Visual Basic

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.