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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:33:19+00:00 2026-06-06T19:33:19+00:00

I have a highly formatted file with large amount of data which I used

  • 0

I have a highly formatted file with large amount of data which I used pretty frequently so I store it into std::map and serialize it with boost::serialization library. the serialization code looks like this:

boost::iostreams::filtering_ostream ofs {};
ofs.push (boost::iostreams::zlib_compressor ());
ofs.push (boost::iostreams::file_sink (file_name));
boost::archive::binary_oarchive oa {ofs};
oa << my_map;

But every time I might just need part of the map, like a certain key-value pair. So I am wondering whether I can partially de-serialize the map from the file and only retrieving the pair I specify? In this way I don’t have to read the whole file into memory.

  • 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-06T19:33:21+00:00Added an answer on June 6, 2026 at 7:33 pm

    You could make an index of your data, though that’s a bit harder to use in the presence of compression. If your data file was uncompressed, and say each record was on one line, then you could make an index in which you store consecutive offsets of each line in fixed-width records, say unsigned 64-bit numbers.

    To locate line 5112, you’d open the index, seek to 5112 * 8, and read two uint64_ts, say a and b. Then you open your data file, seek to a and read b - a bytes, which is your record.

    If the data is compressed, you’ll have to look at your compression library and see if it allows you to partially decompress only that region of the file which contains the bytes [a, b).

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

Sidebar

Related Questions

I have a Singleton class which is highly dependent on the XML file it
In a Python Google App Engine environment, I have some highly volatile data which
I have intranet highly user interactive ASP.net applications, which now I am going to
I have a web-based application which is very highly reliant on jquery / javascript,
We have an app with highly interrelated data, i.e. there are many cases where
I have the following (highly simplified) XML document that I am reading into my
I have been asked to develop a highly secure B2B File Transfer system between
I have a highly nested OBJECT TYPE structure that allows me to hold data
i have a highly data computation intensive application that has to process data received
Hey all, I have highly repetitive data with a depth of 5 nodes deep

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.