• Advertisement
Sign in to follow this  

Using bytes array as it was a file

This topic is 2615 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Assume that I have an array of bytes(100500), how can I use it as it was a file( i.e. Loading model with fbxsdk) ? Or do I have to create a temp file? Any help is welcome.

Share this post


Link to post
Share on other sites
Advertisement
In C# you could create a memory stream from the bytes which can be use like a file stream (like any other stream really). Does anyone know if there's something similar in the C++ stream library? I'd like to know the answer to this myself actually.

[Edited by - doesnotcompute on December 28, 2010 2:56:43 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by doesnotcompute
In C# you could create a memory stream from the bytes which can be use like a file stream (like any other stream really). Does anyone know if there's something similar in the C++ stream library? I'd like to know the answer to this myself actually.


If you write your code against the base interface std::iostream, you can interchange file streams, memory-backed streams, network-backed streams, or anything else that conforms to the interface. Pretty handy and basically the exact corresponding concept to doing that in C#.

Share this post


Link to post
Share on other sites
Quote:
Original post by Zahlman
Um... std::stringstream? Guys? Yeah? It lives in <sstream>.


I interpreted the question as being able to have a function like LoadFBX( "c:\model.fbx" ); but instead parse an array from RAM

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement