CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008
    Posts
    10

    Storing a Stream!

    Okay, well the issue I am having is that I am trying to find an effective way to store a stream.. What I am currently doing is I am trying to write a NavMesh for a game. I'm able to read the data files but it comes across as a stream Length = 1458763 which is pretty huge to just store consider since there are like 500 different files all which are that long I just wanna store them until I pull the data I need. Then have them removed... As a NavMesh I want an effective way that will use next to no process, if someone could point me in the right direction I would be most greatful!

    -Thanks

  2. #2
    Join Date
    May 2007
    Posts
    1,546

    Re: Storing a Stream!

    Well, you either need to change your datastructure so you can represent the same data in a more compact way, or you need to only load files *when required* and ditch them when they're no longer needed, or just bite the bullet and eat a lot of memory. If you're going for option B, you could implement a MemoryBuffer, so you keep the last X most recent datasets in memory with the idea that the most recent one is going to be used a lot so you'd benefit from having it stored in memory.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured